cyclopentane [Fri, 16 Jan 2026 23:54:51 +0000 (00:54 +0100)]
cryptenroll,cryptsetup,shutdown: only call mlockall if we have CAP_IPC_LOCK
Calling mlockall in an unprivileged process most notably had the effect
of making systemd-cryptenroll OOM while trying to open a normal-sized
argon2 keyslot due to it hitting RLIMIT_MEMLOCK.
Mike Yuan [Fri, 9 Jan 2026 18:06:07 +0000 (19:06 +0100)]
core/unit: drop unneeded unit_modify_nft_set() call during coldplug
We re-realize all unit cgroups upon daemon-reload, and
cgroup_context_apply() would take care of NFT set refreshing.
No need to duplicate that in unit_coldplug().
Mike Yuan [Fri, 16 Jan 2026 19:53:47 +0000 (20:53 +0100)]
core/unit: several cleanups for unit_queue_job_check_and_collapse_type()
* Rename to _mangle_type() - it turned out this one doesn't collapse
anything, but rather mangles the type if reload_if_possible is set.
Hence name accordingly.
* Use -ELIBEXEC rather than -EUNATCH to denote dependency only units.
* Add a comment about the JOB_STOP and load state check.
chase: optimize the special case where no root dir specified
Now that we can recognize the root dir in chaseat() sanely, let's use it
top optimize the very common special case where we have no root dir to
consider, and directly call open_tree().
fd-util: introduce XAT_FDROOT fd shortcut for the root dir
This takes inspiration from AT_FDCWD, but always references the root dir
rather than the cwd. This allows various convenience uses, as we can now
reference the root dir without actually allocating an fd for chaseat(),
fd_get_path() and various others.
The value of XAT_FDROOT is chosen so that it is not a valid fd (essential,
because we do not intend to hook this up everywhere, just where we need
it, just like AT_FCWD only works in some syscalls), and we want uses at
the wrong places to fail cleanly. It also uses a valud outside of the
range where we usually return negative errnos, i.e. < -ERRNO_MAX.
socket: turn of loud logging when setting up sockopts in container fails due to privs
Various socktops will fail if we run in a container, due to lack of
privs (for example SO_RECVFORCE as used by the journald sockets). That's
typically not a big issue. Hence downgrade the log level.
Michael Vogt [Fri, 16 Jan 2026 15:25:19 +0000 (16:25 +0100)]
boot: change some `log_error` -> `log_warning` where appropriate
This is a small followup for
https://github.com/systemd/systemd/pull/40344#discussion_r2695031041
(thanks Daan and Lennart!).
There are quite a few places in the code that currently log a
`log_error()` when a `log_warning()` is more appropriate because
the error is ignored. This commit now shows those as warnings.
Luca Boccassi [Fri, 16 Jan 2026 14:55:02 +0000 (14:55 +0000)]
dissect: support mount options when going through mountfsd, requiring privileges via polkit (#39394)
RootImageOptions=/ExtensionImages=/MountImages= all support custom
mount options, but mountfsd does not support it. Add varlink
parameters to allow callers to specify mount options so that
those directives can work as expected. Require additional privs via
polkit.
Yu Watanabe [Tue, 13 Jan 2026 06:48:56 +0000 (15:48 +0900)]
udevadm: gracefully handle when a maked file is specified to udevadm verify/cat
Previously, since 7cb4508c5af465ab1be1b103e6c2b613eb58e63c, if a masked
file is specified, the commands failed.
Let's warn that the file is masked and ignore the file.
gvenugo3 [Sat, 10 Jan 2026 19:46:18 +0000 (19:46 +0000)]
test: add test case for masked files in cat_files()
Add a test case to verify that cat_files() correctly handles symlinks
to /dev/null (masked configuration files) and returns success (0)
instead of failing.
Yu Watanabe [Tue, 13 Jan 2026 06:39:39 +0000 (15:39 +0900)]
pretty-print: do not fail when cat_files() tries to show a masked file
Before 661b5bfd216e383ac7836261eea9671875e6709b, cat_files() does not
check if a file is regular. If the file is a symlink to /dev/null, then
cat_files() simply shows an empty contents for the file.
With the offending commit, as the CHASE_MUST_BE_REGULAR flag is set,
hence when we found a masked file, the function fails.
Franck Bui [Wed, 14 Jan 2026 09:40:46 +0000 (10:40 +0100)]
core/dbus-manager: propagate meaningful dbus errors from EnqueueMarkedJobs
Previously, when `systemctl reload-or-restart --marked` failed the following
error was shown:
Failed to start jobs: Failed to enqueue some jobs, see logs for details: Invalid argument
but no details were actually logged.
This change records failure reasons in the journal to help users identify root causes:
# journalctl -b -e
[...]
systemd[1]: Queuing reload/restart jobs for marked units…
systemd[1]: Operation refused, unit klogd.service may be requested by dependency only (it is configured to refuse manual start/stop).
Daan De Meyer [Wed, 26 Nov 2025 11:55:18 +0000 (12:55 +0100)]
sd-varlink: Add SD_VARLINK_ANY
This allows representing fields that can be either an integer or
a string, like the "value" field we'll be adding in
https://github.com/systemd/systemd/pull/39202.
Split up the giant switch statement in homectl's parse_argv (#40059)
This is in preparation for later changes. The 1500+ line switch statement was very
hard to work with and had quite a bit of duplicated code. This is a rework that
splits outs parts into functions. I split this up into a bunch of commits so that it
can be reasonably reviewed. When viewed as one giant commit, diff just shows
a giant block of removed code and a giant block of added code.
In some cases I wasn't sure why one or the other of the identity arrays is used…
I preserved existing behaviour in all cases.
Daan De Meyer [Sat, 20 Dec 2025 20:38:09 +0000 (21:38 +0100)]
vpick: Fix pick_filter_image_any
Currently, pick_filter_image_any matches any image
with any suffix, which is way more than it should
be doing. It should only be matching images with
the .raw suffix.
Let's address this shortcoming by allowing to pass
multiple filters to path_pick(), and define
pick_filter_image_any as the combination of the
raw and directory image filters.
Michal Sekletar [Fri, 9 Jan 2026 16:18:41 +0000 (17:18 +0100)]
core: only activate transaction that contain useful jobs
If no real jobs were added to the transaction, do not activate it.
The JOB_NOP anchor does not perform any useful work and activating
such transaction only wastes resources.
Michael Vogt [Wed, 14 Jan 2026 08:01:46 +0000 (09:01 +0100)]
man: fix copy/paste issue in systemd-vmspawn.xml
The systemd-vmspawn man page has a note that the `--notify-ready`
defaults to "true" and then says that this is unlike "systemd-vmspawn"
where it defaults to "false". This appears to be a copy/paste issue
and here we want "unlike systemd-nspawn".