]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 months agomkosi: update fedora commit reference 36875/head
Daan De Meyer [Thu, 27 Mar 2025 20:49:47 +0000 (21:49 +0100)] 
mkosi: update fedora commit reference

617952132d Run integration testsuite standalone if available

8 months agotest: Fix symlink location of standalone tests
Daan De Meyer [Thu, 27 Mar 2025 21:48:42 +0000 (22:48 +0100)] 
test: Fix symlink location of standalone tests

This was accidentally moved to the wrong folder so fix up the location
so it's located in the standalone/ folder as expected.

8 months agotest: Make it possible to run the integration tests standalone (#36868)
Daan De Meyer [Thu, 27 Mar 2025 20:38:00 +0000 (21:38 +0100)] 
test: Make it possible to run the integration tests standalone (#36868)

Currently, to run the integration tests, it's still necessary to
install various other build tools besides meson: A compiler, gperf,
libcap, ... which we want to avoid in CI systems where we receive
prebuilt systemd packages and only want to test them. Examples are
Debian's autopkgtest CI and Fedora CI. Let's make it possible for
these systems to run the integration tests without having to install
any other build dependency besides meson by extracting the logic
required to run the integration tests with meson into a separate
subdirectory and adding a standalone top-level meson.build file which
can be used to configure a meson tree with as its only purpose running
the integration tests.

Practically, we do the following:
- all the integration test directories and integration-test-wrapper.py
  are moved from test/ to test/integration-tests/.
- All the installation logic is kept out of test/integration-tests/ or
  any of its subdirectories and moved into test/meson.build instead.
- We add test/integration-tests/standalone/meson.build to run the
  integration tests standalone. This meson file includes
  test/integration-tests via a cute symlink hack to trick meson into
  including a parent directory with subdir().
- Documentation is included on how to use the new standalone mode.

8 months agotest: Make it possible to run the integration tests standalone 36868/head
Daan De Meyer [Wed, 26 Mar 2025 13:30:20 +0000 (14:30 +0100)] 
test: Make it possible to run the integration tests standalone

Currently, to run the integration tests, it's still necessary to
install various other build tools besides meson: A compiler, gperf,
libcap, ... which we want to avoid in CI systems where we receive
prebuilt systemd packages and only want to test them. Examples are
Debian's autopkgtest CI and Fedora CI. Let's make it possible for
these systems to run the integration tests without having to install
any other build dependency besides meson by extracting the logic
required to run the integration tests with meson into a separate
subdirectory and adding a standalone top-level meson.build file which
can be used to configure a meson tree with as its only purpose running
the integration tests.

Practically, we do the following:
- all the integration test directories and integration-test-wrapper.py
  are moved from test/ to test/integration-test/.
- All the installation logic is kept out of test/integration-test/ or
  any of its subdirectories and moved into test/meson.build instead.
- We add test/integration-test/standalone/meson.build to run the
  integration tests standalone. This meson file includes
  test/integration-test via a cute symlink hack to trick meson into
  including a parent directory with subdir().
- Documentation is included on how to use the new standalone mode.
- TEST-64-UDEV-STORAGE and TEST-85-NETWORK are changed to generate separate
  units for each testcase to make them behave more like the other integration
  tests.

8 months agoac-power: update the help output to use the ansi-color functions
ZIHCO [Wed, 26 Mar 2025 19:50:15 +0000 (20:50 +0100)] 
ac-power: update the help output to use the ansi-color functions

8 months agocore: drop manager_get_unit_by_pid() and friends (#36872)
Yu Watanabe [Wed, 26 Mar 2025 21:10:53 +0000 (06:10 +0900)] 
core: drop manager_get_unit_by_pid() and friends (#36872)

Except for one place, they are only used by test-watch-pid. Let's also
use manager_get_unit_by_pidref() and friends in the test, and drop the
_pid() variants.

8 months agocore/cgroup: Properly handle aborting a pending freeze operation
msizanoen [Tue, 18 Mar 2025 05:47:21 +0000 (12:47 +0700)] 
core/cgroup: Properly handle aborting a pending freeze operation

We must thaw the cgroup even if cgroup.events/frozen=0 if a freeze
operation is in flight as it means the cgroup is already partially
frozen.

8 months agocoredump: make sure pid1/journal coredumps are not lost when Storage=journal is selec...
Yu Watanabe [Wed, 26 Mar 2025 19:27:01 +0000 (04:27 +0900)] 
coredump: make sure pid1/journal coredumps are not lost when Storage=journal is selected (#36870)

It confused the hell of me, that if pid1 crashes in an mkosi system run
from the build tree there's no coredump kept. Because mkosi configures
journal storage for coredumps, but that's not going to work for pid1 or
journald. Hence use external storage for these two even if everything
else is stored in the journal.

8 months agocore: drop unused wrappers of manager_get_unit_by_pidref() and friends 36872/head
Yu Watanabe [Wed, 26 Mar 2025 19:15:43 +0000 (04:15 +0900)] 
core: drop unused wrappers of manager_get_unit_by_pidref() and friends

8 months agotest-watch-pid: use pidref_safe_fork() with FORK_FREEZE
Yu Watanabe [Wed, 26 Mar 2025 19:02:26 +0000 (04:02 +0900)] 
test-watch-pid: use pidref_safe_fork() with FORK_FREEZE

Then, use pidref version of functions.

8 months agotest-watch-pid: move required test conditions to intro()
Yu Watanabe [Wed, 26 Mar 2025 18:56:46 +0000 (03:56 +0900)] 
test-watch-pid: move required test conditions to intro()

Follow-up for 7bcd76513a61f8f16f2cc9b291895779c7c367fe.

8 months agocoredump: do not disable removal of temporary coredump file 36870/head
Lennart Poettering [Wed, 26 Mar 2025 15:28:32 +0000 (11:28 -0400)] 
coredump: do not disable removal of temporary coredump file

8 months agocoredump: make sure we initialize all return parameters on success of save_external_c...
Lennart Poettering [Wed, 26 Mar 2025 15:25:47 +0000 (11:25 -0400)] 
coredump: make sure we initialize all return parameters on success of save_external_coredump()

8 months agocoredump: do not remove PID1/journal coredumps if Storage=journal is used
Lennart Poettering [Wed, 26 Mar 2025 15:22:01 +0000 (11:22 -0400)] 
coredump: do not remove PID1/journal coredumps if Storage=journal is used

We always redirect PID1/journal coredumps directly onto disk instead of
the journal even if that's configured because that might cause a
deadlock because we are still pinning the old journal process while
processing the coredump. However, so far we then immediately deleted the
coredumps because of Storage=journal, which is very annoying, since
there's hence no copy kept whatsoever.

Let's hence exclude PID1+journal from the removal.

This in particulary brings the code in line with the log messages which
claim we kept the file around but we actually did not.

8 months agocoredump: rename fix_permissions() → fix_permissions_and_link()
Lennart Poettering [Wed, 26 Mar 2025 15:20:12 +0000 (11:20 -0400)] 
coredump: rename fix_permissions() → fix_permissions_and_link()

The function doesn't just adjust permissions, it actually moves the
file into place. The function name should really make this fundamental
fact clear.

8 months agotest: update to use the new ASSERT_OK() macro and friends (#36838)
Luca Boccassi [Wed, 26 Mar 2025 15:21:55 +0000 (15:21 +0000)] 
test: update to use the new ASSERT_OK() macro and friends (#36838)

Converted the unitest implemented in src/test/test-watch-pid.c that
still uses assert_se() to use the new ASSERT_OK() macro and friends.

8 months agomeson: Drop project_source_root and project_build_root variables
Daan De Meyer [Wed, 26 Mar 2025 12:57:33 +0000 (13:57 +0100)] 
meson: Drop project_source_root and project_build_root variables

We can now rely on meson.project_source_root() and meson.project_build_root()
which do the same thing.

8 months agotree-wide: Update outdated docs on removed old integration test stuff
Daan De Meyer [Wed, 26 Mar 2025 12:41:46 +0000 (13:41 +0100)] 
tree-wide: Update outdated docs on removed old integration test stuff

8 months agoRevert "test: dynamically generate list of test cases"
Daan De Meyer [Wed, 26 Mar 2025 12:18:40 +0000 (13:18 +0100)] 
Revert "test: dynamically generate list of test cases"

We want to decouple the integration tests in meson from the
rest of the source files so the integration tests can be run
without the source files available. Let's revert the change to
dynamically figure out the test cases from the networkd tests for
now so that the tests can be generated without the test source file
being available.

This reverts commit 514458604b29663bc02c9d0e310f06e0ed682ae9.

8 months agoREADME: Drop test packages
Daan De Meyer [Wed, 26 Mar 2025 12:35:35 +0000 (13:35 +0100)] 
README: Drop test packages

This has bitrotted so let's just drop it as it's woefully out of date
and not really in the right location to be useful to anyone.

8 months agotest: Make sure serial is always set explicitly for scsi-hd qemu devices
Daan De Meyer [Wed, 26 Mar 2025 09:26:36 +0000 (10:26 +0100)] 
test: Make sure serial is always set explicitly for scsi-hd qemu devices

Now that mkosi uses -blockdev instead -drive, the device_id property
of scsi-hd devices is not populated automatically anymore so we have to
make sure to always specify serial= to make sure /dev/disk/by-id is populated
as expected in the test.

8 months agomkosi: Add back .mkosi-private/ to .gitignore
Daan De Meyer [Tue, 25 Mar 2025 20:00:08 +0000 (21:00 +0100)] 
mkosi: Add back .mkosi-private/ to .gitignore

Required to exclude the history data;

8 months agotest: update to use DEFINE_TEST_MAIN_WITH_INTRO() macro 36838/head
ZIHCO [Tue, 25 Mar 2025 16:11:46 +0000 (17:11 +0100)] 
test: update to use DEFINE_TEST_MAIN_WITH_INTRO() macro

8 months agotest: update to use the new ASSERT_OK() macro and friends
ZIHCO [Mon, 24 Mar 2025 07:22:40 +0000 (08:22 +0100)] 
test: update to use the new ASSERT_OK() macro and friends

8 months agoman: Add AssertVersion= to documentation (#36862)
Steve Ramage [Wed, 26 Mar 2025 01:34:59 +0000 (18:34 -0700)] 
man: Add AssertVersion= to documentation (#36862)

8 months agologind: inhibitor fixups (#36817)
Luca Boccassi [Wed, 26 Mar 2025 00:22:27 +0000 (00:22 +0000)] 
logind: inhibitor fixups (#36817)

8 months agopolkit: use -EBUSY to indicate shortcut after error or denial 36817/head
Nick Rosbrook [Mon, 24 Mar 2025 13:06:33 +0000 (09:06 -0400)] 
polkit: use -EBUSY to indicate shortcut after error or denial

Commit 536c18e5c3 ("bus-polkit: shortcut auth. after first denial")
added logic to async_polkit_query_check_action() that returns
-EALREADY when a failure or denial decision was made for a previous
action.

Tweak this to return -EBUSY instead of -EALREADY. This hopefully makes
the intent of the error more clear. EALREADY suggests that the request
is OK, but polkit is processing something else, and we should come back
later. EBUSY suggests that polkit is busy or unusable, hence the
request cannot be processed, and we should go away.

8 months agologin: add polkit example rules for allowing root to ignore inhibitors
Nick Rosbrook [Fri, 21 Mar 2025 19:14:20 +0000 (15:14 -0400)] 
login: add polkit example rules for allowing root to ignore inhibitors

The semantics of strong inhibitors require that POLKIT_ALWAYS_QUERY
always be set when checking if we can allow blocking inhibitors to be
ignored on shutdown, reboot, etc. With the default polkit rules and
policy, users may experience a situation where users in the sudo group
are authorized to run:

 systemctl reboot --check-inhibitors=no

but the root user is not authorized. Instead, the following error is
given:

 Call to Reboot failed: Interactive authentication required.

While this is correct according to the semantics of strong inhibitors,
it is confusing. To help the situation, provide example polkit rules
that allow root to perform these actions.

Finally, when root receives SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED
when calling e.g. systemctl reboot, print a message explaining that this
is due to the current polkit policy, and point to the new example rule.

Related: https://github.com/systemd/systemd/issues/36786

8 months agologin: handle -EALREADY from bus_verify_polkit_async_full()
Nick Rosbrook [Fri, 21 Mar 2025 18:38:20 +0000 (14:38 -0400)] 
login: handle -EALREADY from bus_verify_polkit_async_full()

Commit 536c18e5c3 ("bus-polkit: shortcut auth. after first denial")
added logic to async_polkit_query_check_action() that returns
-EALREADY when a failure or denial decision was made for a previous
action.

This has the consequence that root is able to ignore inhibitors and
shutdown etc. even when polkit explicitly denies it. This is because
when systemctl's verb_start_special() calls logind_reboot(), unless
the call succeeds or returns one of -EACCES, -EOPNOTSUPP, or
-EINPROGRESS, a fallback path is taken to attempt the action without
going through logind. Hence, since logind_reboot() started returning
-EALREADY in some cases, the fallback path was taken, and the shutdown
was performed anyways.

For example:

 root@ubuntu:/# cat /etc/polkit-1/rules.d/10-systemd-logind-no-skip-inhibitors.rules
 // Never allow strong inhibitors to be ignored.
 polkit.addRule(function(action, subject) {
     if ((action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
          action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
          action.id == "org.freedesktop.login1.halt-ignore-inhibit" ||
          action.id == "org.freedesktop.login1.suspend-ignore-inhibit" ||
          action.id == "org.freedesktop.login1.hibernate-ignore-inhibit")) {

         return polkit.Result.NO;
     }
 });
 root@ubuntu:/# systemctl reboot -i
 Call to Reboot failed: Operation already in progress

..but the reboot continues anyways due to the fallback.

To fix this, add logic in systemd-logind's verify_shutdown_creds() to
handle -EALREADY from bus_verify_polkit_async_full(): if we receive
-EALREADY when checking authorization for <action>-multiple-sessions,
and we are blocked on inhibitors, continue on to get the decision for
<action>-ignore-inhibit directly.

While here, add similar logic to method_inhibit(), which may need to
verify multiple polkit actions in a single call.

Fixes 536c18e5c33fd682fcd38d228b46a339adbe150b

8 months agopolkit: fix the ordering of a log message
Nick Rosbrook [Thu, 20 Mar 2025 11:07:08 +0000 (07:07 -0400)] 
polkit: fix the ordering of a log message

8 months agotools/check-version-history: avoid DeprecationWarning with newer lxml (#36860)
Luca Boccassi [Tue, 25 Mar 2025 19:34:44 +0000 (19:34 +0000)] 
tools/check-version-history: avoid DeprecationWarning with newer lxml (#36860)

We get the same warning thousands of times:
/work/src/tools/check-version-history.py:28: FutureWarning: This search
incorrectly ignores the root element, and will be fixed in a future
version. If you rely on the current behaviour, change it to

"./refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='udev_device_get_properties_list_entry']"

We also need to update the ignorelist to the new form.

8 months agogitignore: add .mkosi-private/ to the list again 36860/head
Zbigniew Jędrzejewski-Szmek [Tue, 25 Mar 2025 16:37:48 +0000 (17:37 +0100)] 
gitignore: add .mkosi-private/ to the list again

It was dropped in 9f9da8a1c61a01d6367d517d2e8dcfa85ae6795d and is
messing up CI now.

8 months agotools/check-version-history: avoid DeprecationWarning with newer lxml
Zbigniew Jędrzejewski-Szmek [Tue, 25 Mar 2025 16:16:16 +0000 (17:16 +0100)] 
tools/check-version-history: avoid DeprecationWarning with newer lxml

We get the same warning thousands of times:
/work/src/tools/check-version-history.py:28: FutureWarning: This search incorrectly
ignores the root element, and will be fixed in a future version. If you rely on the
current behaviour, change it to
"./refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='udev_device_get_properties_list_entry']"

We also need to update the ignorelist to the new form.

8 months agomkosi: Add two more mkosi entries to .gitignore
Daan De Meyer [Tue, 25 Mar 2025 14:28:42 +0000 (15:28 +0100)] 
mkosi: Add two more mkosi entries to .gitignore

Also get rid of a bunch of outdated entries that don't apply anymore.

8 months agomkosi: update fedora commit reference
Daan De Meyer [Tue, 25 Mar 2025 12:36:53 +0000 (13:36 +0100)] 
mkosi: update fedora commit reference

13d523f84d Relax dependencies from noarch packages on archful packages for OBS builds
59378485be Remove purge-nobody-user script
d1380dc114 Add more services to %post for udev and networkd
6f0d03443d Fix paths for /usr/sbin/nologin and related progs
df9a74d530 Make the source tarball glob in the test script more generic

8 months agotest: Disable pager in integration test units
Daan De Meyer [Tue, 25 Mar 2025 09:37:32 +0000 (10:37 +0100)] 
test: Disable pager in integration test units

Integration test units are now connected to the tty when running
interactively, so let's make sure we disable the pager to avoid tests
hanging in the pager.

8 months agoTrivial updates for docs and comments (#36854)
Luca Boccassi [Tue, 25 Mar 2025 10:37:42 +0000 (10:37 +0000)] 
Trivial updates for docs and comments (#36854)

8 months agoman/systed.swap: update description of implicit deps 36854/head
Zbigniew Jędrzejewski-Szmek [Tue, 25 Mar 2025 09:40:12 +0000 (10:40 +0100)] 
man/systed.swap: update description of implicit deps

This changed in e3e6f996894f0eea0e766b4194922f5c7235fb01.
Closes https://github.com/systemd/systemd/issues/36761.

8 months agoman/systemd-remount-fs: fix grammar
Zbigniew Jędrzejewski-Szmek [Mon, 24 Mar 2025 21:04:04 +0000 (22:04 +0100)] 
man/systemd-remount-fs: fix grammar

8 months agoman/varlinkctl: remove unneeded absolute path in example
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2024 22:38:40 +0000 (23:38 +0100)] 
man/varlinkctl: remove unneeded absolute path in example

8 months agoremount-fs: adjust comment
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jan 2025 09:32:30 +0000 (10:32 +0100)] 
remount-fs: adjust comment

8 months agoRatelimit attempts to open watchdog, increase logging (#35708)
Zbigniew Jędrzejewski-Szmek [Mon, 24 Mar 2025 20:06:57 +0000 (21:06 +0100)] 
Ratelimit attempts to open watchdog, increase logging (#35708)

8 months agoman: fix typo in org.freedesktop.systemd1.xml
Luca Boccassi [Mon, 24 Mar 2025 18:25:29 +0000 (18:25 +0000)] 
man: fix typo in org.freedesktop.systemd1.xml

8 months agotest: update to use the new ASSERT_OK() macro and friends
Busayo Dada [Mon, 24 Mar 2025 12:28:20 +0000 (13:28 +0100)] 
test: update to use the new ASSERT_OK() macro and friends

8 months agoman/timedatectl: add reference to systemd.time(7)
Yu Watanabe [Mon, 24 Mar 2025 11:43:53 +0000 (20:43 +0900)] 
man/timedatectl: add reference to systemd.time(7)

Closes #36839.

8 months agotree-wide: introduce LOG_ITEM() macro for verifying format string (#36780)
Luca Boccassi [Mon, 24 Mar 2025 12:58:14 +0000 (12:58 +0000)] 
tree-wide: introduce LOG_ITEM() macro for verifying format string (#36780)

This introduce `LOG_ITEM()` macro that checks format strings in
log_struct() and friends.

Hopefully, this silences false-positive warnings by Coverity.

8 months agoman/networkd.conf: revert unexpected replacement of PersistLeases= setting
Yu Watanabe [Mon, 24 Mar 2025 10:25:01 +0000 (19:25 +0900)] 
man/networkd.conf: revert unexpected replacement of PersistLeases= setting

The entry was unexpectedly replaced by the commit
418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b (v256).
This reverts the change.

Fixes #36837.

8 months agouser-record: Allow/strip status for mask/extract privileged helpers
Daan De Meyer [Sun, 23 Mar 2025 21:52:10 +0000 (22:52 +0100)] 
user-record: Allow/strip status for mask/extract privileged helpers

If we're using these helpers, we want to split a user record into two,
one with the privileged section, and one without. This should work even
when the user record has a "status" section, so adapt the helpers to
account for that.

8 months agocore/manager: do not exclude watchdog logic from busy-loop protection 35708/head
Zbigniew Jędrzejewski-Szmek [Fri, 21 Mar 2025 14:06:28 +0000 (15:06 +0100)] 
core/manager: do not exclude watchdog logic from busy-loop protection

As reported in https://github.com/systemd/systemd/issues/35405, if the watchdog
ping failed, we effectively started a busy loop here. The previous commits
should fix this, but in general, the protection here is intended as a safety
net in case the logic is broken somewhere else. We shouldn't exclude the
watchdog stuff from this.

8 months agoshared/watchdog: give up after a few failed pings
Zbigniew Jędrzejewski-Szmek [Fri, 21 Mar 2025 13:39:50 +0000 (14:39 +0100)] 
shared/watchdog: give up after a few failed pings

Closes https://github.com/systemd/systemd/issues/35405. Apparently some
watchdog devices can be opened, but then the pings start failing after some
time. Since the timestamp of the last successful ping is not updated, we try to
ping again immediately, causing a busy loop and excessive logging.

After trying a few different approaches to fit this into the existing framework
without changing the logic too much, I settled on an approach with a second
timestamp. In particular, the timestamp of the last successful ping is public,
exposed as WatchdogLastPingTimestamp over dbus. It'd be wrong to redefine this
to mean the last ping *attempt*. So we need a second timestamp in some form.

Also, if we give up on pinging, we probably should attempt to disarm the
watchdog. It's possible that the pinging fails, but the watchdog would still
fire. I don't think we want that, since it seems that our internal loop is
working, it's just the watchdog that is broken.

Structured message with SD_MESSAGE_WATCHDOG_PING_FAILED is logged if we fail
to ping.

I tested this by attaching gdb to pid 1 and calling close(watchdog_fd).
We get a bunch of warning messages and then an attempt to close the watchdog:
Mar 21 15:46:17 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:20 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:23 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:26 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:29 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:32 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:35 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:37 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:40 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:43 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:46 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:49 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:52 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:55 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0: Bad file descriptor
Mar 21 15:46:58 fedora systemd[1]: Failed to ping hardware watchdog /dev/watchdog0, closing watchdog after 15 attempts: Bad file descriptor
Mar 21 15:46:58 fedora systemd[1]: Failed to disable hardware watchdog, ignoring: Bad file descriptor
Mar 21 15:46:58 fedora systemd[1]: Failed to disarm watchdog timer, ignoring: Bad file descriptor

8 months agonetworkd: add support for setting vlan_tunnel on bridge ports
Erik Larsson [Sat, 22 Mar 2025 14:40:35 +0000 (15:40 +0100)] 
networkd: add support for setting vlan_tunnel on bridge ports

8 months agosome dbus property fixes (#36830)
Luca Boccassi [Sat, 22 Mar 2025 15:54:16 +0000 (15:54 +0000)] 
some dbus property fixes (#36830)

8 months agocore: not sure why but TTYRows/TTYColumns property is 16bit towards outside, 32bit... 36830/head
Lennart Poettering [Fri, 21 Mar 2025 16:51:18 +0000 (17:51 +0100)] 
core: not sure why but TTYRows/TTYColumns property is 16bit towards outside, 32bit inside, handle that properly

8 months agocore: fix C type handler for ExitCode property
Lennart Poettering [Fri, 21 Mar 2025 16:38:26 +0000 (17:38 +0100)] 
core: fix C type handler for ExitCode property

8 months agomkosi: Hide patches on debian instead of removing them
Daan De Meyer [Fri, 21 Mar 2025 21:02:19 +0000 (22:02 +0100)] 
mkosi: Hide patches on debian instead of removing them

8 months agofetch-distro: Fetch before we switch branches
Daan De Meyer [Fri, 21 Mar 2025 20:34:12 +0000 (21:34 +0100)] 
fetch-distro: Fetch before we switch branches

Otherwise the branch we're switching to might not exist yet.

8 months agopackit: Load fmf metadata from rpm spec repository (#36825)
Daan De Meyer [Fri, 21 Mar 2025 16:28:43 +0000 (17:28 +0100)] 
packit: Load fmf metadata from rpm spec repository (#36825)

8 months agopackit: Load fmf metadata from rpm spec repository 36825/head
Daan De Meyer [Fri, 21 Mar 2025 14:13:22 +0000 (15:13 +0100)] 
packit: Load fmf metadata from rpm spec repository

Maintaining the fmf metadata and script upstream makes it painful
to reuse downstream so let's move the metadata and testing script
downstream and load it upstream instead.

8 months agomkosi: update fedora commit reference
Daan De Meyer [Fri, 21 Mar 2025 15:30:12 +0000 (16:30 +0100)] 
mkosi: update fedora commit reference

2ecfbec1a4 Support specifying extra mkosi repositories to the test script
f5b47b1302 Use old setup sysusers files on Fedora < 43
2da5793357 Merge #196 `Migrate fmf metadata and test script from the upstream repository`
e346d9f33e Limit sdubby dependency to Fedora

8 months agoshared/watchdog: add MESSAGE_IDs to logs about watchdog opening
Zbigniew Jędrzejewski-Szmek [Fri, 21 Mar 2025 11:10:35 +0000 (12:10 +0100)] 
shared/watchdog: add MESSAGE_IDs to logs about watchdog opening

One ID for the success case, with WATCHDOG_DEVICE= showing the device,
and one ID for the failure case, with WATCHDOG_DEVICE= if configured,
and ERRNO= set automatically.

8 months agoshared/watchdog: ratelimit the number of attempts to open watchdog
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 18:14:51 +0000 (19:14 +0100)] 
shared/watchdog: ratelimit the number of attempts to open watchdog

We need to retry the open attempts for the watchdog, because the device becomes
available asynchronously.

The watchdog is opened in two places:

- in pid1 in the main loop. The loop has a ratelimit, but during a boot we
  iterate in it fairly quickly. On my test VM with 'iTCO_wdt', version 2:

    $ journalctl -b --grep 'Failed to open any watchdog' | wc -l
    3398

  After the device has been processed by udev, it is initialized successfully.

- in shutdown. In that case, we most likely don't need to try more than once,
  because we mostly care about the case where the watchdog device was present
  and configured previously. But in principle it is possible that we might
  attempt shutdown while the machine was initializing, so we don't want to
  disable retries. Nevertheless, watchdog_ping() is called from a loop that
  might be fairly tight, so we could end up trying to reopen the device fairly
  often. This probably doesn't matter *too* much, but it's still ugly to try to
  open the device without any ratelimit.

Usually the watchdog timeout would be set to something like 30 s or a few
minutes. OTOH, on my VM, the device becomes avaiable at 4.35 s after boot. So
let's use 5 s or half the watchdog timeout, whatever is smaller, as the
interval.

8 months agomkosi: Log in mkosi.sync when we don't check out commit
Daan De Meyer [Fri, 21 Mar 2025 13:30:34 +0000 (14:30 +0100)] 
mkosi: Log in mkosi.sync when we don't check out commit

8 months agopo: Translated using Weblate (Spanish)
Jose Ortuno [Fri, 21 Mar 2025 12:57:12 +0000 (12:57 +0000)] 
po: Translated using Weblate (Spanish)

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Jose Ortuno <jose_ortuno@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main

8 months agotest: Check that the journal file was actually created (#36821)
Daan De Meyer [Fri, 21 Mar 2025 13:31:20 +0000 (14:31 +0100)] 
test: Check that the journal file was actually created (#36821)

If the test fails in the mkosi setup logic the journal file will never
be created so let's add some checks.

8 months agoudev: make udevadm and friends not warn about unknown settings
Yu Watanabe [Fri, 21 Mar 2025 00:54:45 +0000 (09:54 +0900)] 
udev: make udevadm and friends not warn about unknown settings

Without this change, when e.g. event_timeout= is specified in udev.conf,
udevadm and friends which loads udev.conf warn about unknown key:
===
$ udevadm info /sys/class/net/lo
/run/udev/udev.conf.d/test-17.conf:1: Unknown key 'event_timeout', ignoring.
/run/udev/udev.conf.d/test-17.conf:2: Unknown key 'timeout_signal', ignoring.
===

Follow-up for 07f5e35fe7967c824a87f18a3a1d3c22e5be70f5 (v256).

8 months agotest: Check that the journal file was actually created 36821/head
Daan De Meyer [Fri, 21 Mar 2025 12:23:31 +0000 (13:23 +0100)] 
test: Check that the journal file was actually created

If the test fails in the mkosi setup logic the journal file will never
be created so let's add some checks.

8 months agopackit: Remove --depth=1 from git clone
Daan De Meyer [Fri, 21 Mar 2025 12:34:11 +0000 (13:34 +0100)] 
packit: Remove --depth=1 from git clone

We need the full history to be able to checkout the right commit
afterwards.

8 months agopid1: log if we failed to find a watchdog device
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 16:56:07 +0000 (17:56 +0100)] 
pid1: log if we failed to find a watchdog device

I think we need to log at some point if the user configured a watchdog device,
but no devices were found. We can't log ENOENT immediately, because the device
may likely appear during boot. So wait until the end of the initial transaction
and log then.

8 months agoshared/watchdog: raise log levels for watchdog errors
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 16:27:57 +0000 (17:27 +0100)] 
shared/watchdog: raise log levels for watchdog errors

If we failed to open the watchdog device for any reason, we'd only log at debug
level. This seems iffy: if the user configured a timeout for the watchdog, we
should report when we can't set it up. ENOENT is still logged at debug level
only, since it's somewhat expected to have a watchdog timeout set up, even for
systems which don't have a watchdog, or the device might appear later.

If the device doesn't support WDIOC_GETSUPPORT, still log that we opened a
device.

No change in behaviour, except for the log level threshold. As a side effect,
the reason why we failed to open the device is now stored in watchdog_fd
(previously it was -1 always), but this isn't used for anything.

8 months agotest-watchdog: modernize
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 14:02:16 +0000 (15:02 +0100)] 
test-watchdog: modernize

8 months agocore/watchdog: initialize variables only if they'll be used
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 13:51:34 +0000 (14:51 +0100)] 
core/watchdog: initialize variables only if they'll be used

This is not a hot path, but let's move the variables to the
minimal scope in which they are needed.

Also, all functions which call watchdog_open() check for fd < 0 first,
so change the conditional return into an assert.

8 months agocore: drop duplicated check in manager_{set,override}_watchdog
Zbigniew Jędrzejewski-Szmek [Fri, 20 Dec 2024 13:31:49 +0000 (14:31 +0100)] 
core: drop duplicated check in manager_{set,override}_watchdog

Those functions call watchdog_setup() and watchdog_setup_pretimeout(), which
internally do a similar check against the static variables watchdog_timeout and
watchdog_pretimeout. The second check is not useful.

8 months agobootctl: adjust feature message (#36372)
Daan De Meyer [Fri, 21 Mar 2025 10:17:00 +0000 (11:17 +0100)] 
bootctl: adjust feature message (#36372)

8 months agoanalyze: propagate error code returned by _from_string()
Yu Watanabe [Thu, 20 Mar 2025 23:37:46 +0000 (08:37 +0900)] 
analyze: propagate error code returned by _from_string()

Follow-up for a483c39fc20aced2178c908405fd020eda753964.
Addresses https://github.com/systemd/systemd/pull/36468#discussion_r2005765024.

8 months agoedit-util: don't leave custom editor args around if we shall fall back (#36813)
Yu Watanabe [Thu, 20 Mar 2025 23:48:05 +0000 (08:48 +0900)] 
edit-util: don't leave custom editor args around if we shall fall back (#36813)

Also, let's complain loudly if the editor acquired from envvar is not
present.

Fixes #36796

8 months agoman: fix typo
Yu Watanabe [Thu, 20 Mar 2025 23:35:08 +0000 (08:35 +0900)] 
man: fix typo

Follow-up for 6fd253753c40e7fbafe2e9a4e64010f9881c1bbb.

8 months agomatch glibc in ConditionVersion
Matteo Croce [Sun, 16 Mar 2025 01:48:29 +0000 (02:48 +0100)] 
match glibc in ConditionVersion

Extend ConditionVersion= to allow matching against glibc version,
as proposed in https://github.com/systemd/systemd/pull/36468#issuecomment-2674600909

8 months agopo: Translated using Weblate (Spanish)
Jose Ortuno [Thu, 20 Mar 2025 20:00:58 +0000 (20:00 +0000)] 
po: Translated using Weblate (Spanish)

Currently translated at 97.2% (250 of 257 strings)

Co-authored-by: Jose Ortuno <jose_ortuno@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main

8 months agocore/meson: libcore doesn't depend on PAM
Mike Yuan [Thu, 20 Mar 2025 15:35:23 +0000 (16:35 +0100)] 
core/meson: libcore doesn't depend on PAM

It's only used by sd-executor.

8 months agoAdd --root for systemd-update-done and other small fixups (#36803)
Lennart Poettering [Thu, 20 Mar 2025 17:19:17 +0000 (18:19 +0100)] 
Add --root for systemd-update-done and other small fixups (#36803)

8 months agoedit-util: don't leave custom editor args around if we shall fall back 36813/head
Mike Yuan [Thu, 20 Mar 2025 16:01:19 +0000 (17:01 +0100)] 
edit-util: don't leave custom editor args around if we shall fall back

Also, let's complain loudly if the editor acquired from envvar
is not present.

Fixes #36796

8 months agomemory-util: make mempcpy_typesafe nestable
Mike Yuan [Thu, 20 Mar 2025 16:27:39 +0000 (17:27 +0100)] 
memory-util: make mempcpy_typesafe nestable

8 months agoupdate-done: create /etc and /var if they didn't exist 36803/head
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 16:06:44 +0000 (17:06 +0100)] 
update-done: create /etc and /var if they didn't exist

Previously, we would fail. But this doesn't seem useful: we may want to
mark the update as done even if /etc/ or /var/ no updates were necessary
and there was no need to create /etc/ or /var/ yet.

8 months agoupdate-done: add --root= arg
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 16:05:20 +0000 (17:05 +0100)] 
update-done: add --root= arg

The idea is to use this when building an image to mark the image as not
needing updates after the reboot. In general it is impossible to say if
any of the early boot update services can be safely skipped, except when
the creator of the image knows all the contents there and has made sure
that all the updates have been processed. (This is in fact what happens
in a typical package-based installation: the packages have scriptlets which
implement the changes during or after the installation process.)

With this patch, the image build process can do 'systemd-update-done --root=…'
at the appropriate point to avoid triggering of ldconfig.service,
systemd-hwdb-update.service, etc.

I didn't write --image=, because it doesn't seem immediately useful. The
approach with --root is most useful when we're building the image "offline",
which means that we have a directory we're working on.

8 months agoupdate-done: add basic argument parsing and --help
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 15:47:02 +0000 (16:47 +0100)] 
update-done: add basic argument parsing and --help

We certainly want to reject calls with any args specified. Previously
we would just silently ignore any args.

8 months agopo: Translated using Weblate (Chinese (Traditional) (zh_TW))
hsu zangmen [Thu, 20 Mar 2025 12:55:17 +0000 (12:55 +0000)] 
po: Translated using Weblate (Chinese (Traditional) (zh_TW))

Currently translated at 88.7% (228 of 257 strings)

Co-authored-by: hsu zangmen <chzang55@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_TW/
Translation: systemd/main

8 months agoupdate-done: split out run()
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 15:28:50 +0000 (16:28 +0100)] 
update-done: split out run()

8 months agoupdate-done: adjust comments
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 15:18:27 +0000 (16:18 +0100)] 
update-done: adjust comments

The man page was right, but the comment in the generated file was wrong. The
timestamp is *not* the timestamp when the update is being done. While at it,
say to what directory the message applies. This makes it easier for a casual
reader to figure out what is happening.

Also rename the function to better reflect what it does.

Inspired by https://github.com/systemd/systemd/issues/36045.

8 months agovmspawn: allow TPM state to be persistent + rework runtime dir logic
Lennart Poettering [Wed, 19 Mar 2025 13:48:35 +0000 (14:48 +0100)] 
vmspawn: allow TPM state to be persistent + rework runtime dir logic

When using vmspawn on particleos image we really want that the TPM state
is retained between invocation, since the encryption key is locked to
the TPM after all. Hence let's support that.

This adds --tpm-state= which can be used to configure a path to store
the TPM state in. It can also be used to force tpm state to be transient
or to let vmpsawn pick the path automatically.

While we are at it, let's also revamp the runtime dir handling in
vmspawn: let's no longer place the sockets the auxiliary services listen
on within their own runtime directories. Instead, just drop the runtime
directories for them entirely (since neither virtiofsd, nor swtpm
actually use them). Also, let systemd clean up the sockets
automatically.

8 months agonetworkd: add support for externally managed vxlan devices
Erik Larsson [Sun, 16 Mar 2025 11:25:35 +0000 (12:25 +0100)] 
networkd: add support for externally managed vxlan devices

With this a vxlan interface can be created which is managed by
for example a EVPN control plane.

8 months agonamespace: use EBADF where appropriate
Lennart Poettering [Tue, 18 Mar 2025 15:00:09 +0000 (16:00 +0100)] 
namespace: use EBADF where appropriate

8 months agopackit: Enable use_target_repo_for_fmf_url option (#36794)
Daan De Meyer [Thu, 20 Mar 2025 08:24:41 +0000 (09:24 +0100)] 
packit: Enable use_target_repo_for_fmf_url option (#36794)

Currently this is picked up from the main branch of the fork which is
suboptimal. The packit folks implemented this new option for us which
should fix the problem.

8 months agofmf: Use mkosi -f together with ToolsTreePackageDirectories= 36794/head
Daan De Meyer [Wed, 19 Mar 2025 13:08:49 +0000 (14:08 +0100)] 
fmf: Use mkosi -f together with ToolsTreePackageDirectories=

There's no need to build various systemd tools from source again to
build the mkosi image when we can just install the packages that were
already built from source into the tools tree so let's do that to avoid
unnecessary compiling.

8 months agofmf: Drop -f from subsequent mkosi sandbox calls
Daan De Meyer [Wed, 19 Mar 2025 13:07:42 +0000 (14:07 +0100)] 
fmf: Drop -f from subsequent mkosi sandbox calls

Only required for the first call to mkosi sandbox, after that we can
assume the tools tree has already been built.

8 months agofmf: Allow overriding the mkosi distribution and release used
Daan De Meyer [Wed, 19 Mar 2025 11:52:36 +0000 (12:52 +0100)] 
fmf: Allow overriding the mkosi distribution and release used

8 months agofmf: Download rpms manually instead of going via repositories
Daan De Meyer [Wed, 19 Mar 2025 11:39:18 +0000 (12:39 +0100)] 
fmf: Download rpms manually instead of going via repositories

This both makes the script more independent, and allows us to add support
for CBS (CentOS Community Build System) at the same time.

8 months agocore: Make DelegateNamespaces= work for user managers with CAP_SYS_ADMIN (#36771)
Yu Watanabe [Wed, 19 Mar 2025 21:28:18 +0000 (06:28 +0900)] 
core: Make DelegateNamespaces= work for user managers with CAP_SYS_ADMIN (#36771)

Currently DelegateNamespaces= only works for services spawned by the
system manager. User managers will always unshare the user namespace
first even if they're running with CAP_SYS_ADMIN.

Let's add support for DelegateNamespaces= for user managers if they're
running with CAP_SYS_ADMIN. By default, we'll still delegate all
namespaces
for user managers, but this can now be overridden by explicitly passing
DelegateNamespaces=.

If a user manager is running without CAP_SYS_ADMIN, the user manager is
still always unshared first just like before.

8 months agoSeveral fixlets for Coverity (#36791)
Lennart Poettering [Wed, 19 Mar 2025 21:27:00 +0000 (22:27 +0100)] 
Several fixlets for Coverity (#36791)

8 months agoIntroduce ConditionVersion (#36468)
Yu Watanabe [Wed, 19 Mar 2025 21:15:35 +0000 (06:15 +0900)] 
Introduce ConditionVersion (#36468)

Add a new condition which can check against systemd version.

        $ systemctl --version
        systemd 258 (258~devel-g53ca5f6)

        $ systemd-analyze condition 'ConditionVersion=systemd>255'
        test.service: ConditionVersion=>255 succeeded.

        $ systemd-analyze condition 'ConditionVersion=systemd>260'
        test.service: ConditionVersion=>260 failed.

        $ systemd-analyze condition 'ConditionVersion=systemd>=258'
        test.service: ConditionVersion=>=258 succeeded.

        $ systemd-analyze condition 'ConditionVersion=systemd>=257.1'
        test.service: ConditionVersion=>=257.1 succeeded.

        $ uname -r
        6.12.13-200.fc41.aarch64

        $ systemd-analyze condition 'ConditionVersion=kernel > 4.4'
        test.service: ConditionVersion=kernel > 4.4 succeeded.

        $ systemd-analyze condition 'ConditionVersion=kernel > 6.20'
        test.service: ConditionVersion=kernel > 6.20 failed.

        $ systemd-analyze condition 'ConditionVersion=kernel < 9.0'
        test.service: ConditionVersion=kernel < 9.0 succeeded.

8 months agocgroup: whenever we migrate a PID to a unit, explicitly drop unit from empty notifica...
Lennart Poettering [Wed, 19 Mar 2025 15:54:27 +0000 (16:54 +0100)] 
cgroup: whenever we migrate a PID to a unit, explicitly drop unit from empty notification queue

A unit might be pending in the empty queue still when we add a PID to
the cgroup. At that point, let's explicitly remove the unit from that
queue.

Fixes: #36781