Commit Graph
57699 Commits
Author SHA1 Message Date
Yu Watanabe a3f0d88fee systemctl: drop unnecessary shortcut for removed SysV compat support
Follow-up for 986fee6217.
2026-01-18 15:48:02 +09:00
Yu Watanabe 01885138be Assorted cleanups (#40373) 2026-01-18 14:41:44 +09:00
Heran YangandJian Wen c55aadc13e core/unit: re-find dropin paths of a unit after writting settings
Fixes: ab932a622d ("core: simplify unit_need_daemon_reload() a bit")
Fixes #35710

Co-authored-by: Jian Wen <wenjianhn@gmail.com>
2026-01-18 14:14:24 +09:00
Mike Yuan 12effc32da 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.
2026-01-17 15:00:10 +01:00
Mike Yuan 490067d41c core/dbus-manager: be explicit that job enqueue errors are from EnqueueMarkedJobs call
Follow-up for 502d6f4bc9
2026-01-17 15:00:10 +01:00
Mike Yuan 7fb883fea8 core/dbus-unit: remove reference to cgroup v1 attribute 2026-01-17 15:00:09 +01:00
Mike Yuan 0fcad6eead core/main: use saturate_add() where appropriate 2026-01-17 15:00:09 +01:00
Mike Yuan 3e9ed98514 logind-varlink: add missing validation for session class
D-Bus CreateSession() method carries this check, but the varlink
one didn't.
2026-01-17 15:00:09 +01:00
Lennart Poettering e09b5366e5 string-util: accept ":" when stripping ANSI color sequences
Since 6eabe9f2ff we generate sequences
with ":", hence we better also know how to strip them.

(Without this patch we'd strip simple ANSI colors, but not RGB ones that
use ":" syntax).

(While we are at it, also drop a duplicate "0" in the list of valid
chars)
2026-01-17 12:07:36 +01:00
Lennart Poettering 24c315e911 ansi-color: convert one more ANSI sequence from ";" to ":" separators
This is a follow-up for 6eabe9f2ff where
one sequence was forgotten.
2026-01-17 12:07:05 +01:00
Lennart Poettering 947ecb0812 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.

Follow-up for: f7df0eab8d
2026-01-17 08:47:14 +09:00
Lennart Poettering 834a7dfc12 hostnamectl: tweak three chassis emojis 2026-01-17 08:46:26 +09:00
Yu Watanabe 7d23749ddd mkfs-utils: also set $E2FSPROGS_FAKE_TIME if $SOURCE_DATE_EPOCH is set
Follow-up for 7bf0d0c46e.

To support e2fsprogs older than v1.47.1 (released 2024-05-21).

Suggested-by: ZauberNerd <zaubernerd@zaubernerd.de>
2026-01-17 08:45:50 +09:00
Michael Vogt 62168b1e9f 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.
2026-01-17 02:52:48 +09:00
Yu Watanabe 4ac445c152 udev/net: support more ethtool features
Closes #39318.
2026-01-17 02:52:20 +09:00
Yu Watanabe b5100a4569 conf-files: several cleanups and fixlets (#40290)
Fixes #40313.
Closes #40285.
2026-01-17 02:51:17 +09:00
Yu Watanabe d5a7f58d1a Also drop SysV rc.local script support (#40295)
Continuation of #39770.
2026-01-17 02:50:08 +09:00
Luca Boccassi 3e2a5dc2e1 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.
2026-01-16 14:55:02 +00:00
Yu Watanabe 2aa496312e conf-files: introduce CONF_FILES_WARN flag and set it at various places
Closes #40285.
2026-01-16 23:05:33 +09:00
Yu Watanabe f25d9e7c0e udevadm: log path prefixed with the specified root directory 2026-01-16 23:05:33 +09:00
Yu Watanabe 782569afd0 udevadm: gracefully handle when a maked file is specified to udevadm verify/cat
Previously, since 7cb4508c5a, if a masked
file is specified, the commands failed.
Let's warn that the file is masked and ignore the file.
2026-01-16 23:05:33 +09:00
gvenugo3andYu Watanabe 01efa01dd2 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.

This test complements the fix for issue #40313.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2026-01-16 23:05:33 +09:00
Yu Watanabeandgvenugo3 f212522923 pretty-print: do not fail when cat_files() tries to show a masked file
Before 661b5bfd21, 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.

Fixes #40313.
Fixes regression caused by 661b5bfd21.

Co-authored-by: gvenugo3 <gvenugo3@asu.edu>
2026-01-16 23:05:28 +09:00
Yu Watanabe 5d0dc9915c conf-files: make conf_file_new() take ConfFilesFlags rather than ChaseFlags
No functional change, preparation for later commit.
2026-01-16 23:01:04 +09:00
Yu Watanabe 0c109deda1 conf-files: use empty_to_root()
No functional change. For consistency with conf_file_chase_and_verify().
2026-01-16 23:01:04 +09:00
Yu Watanabe 4a8e0ea4ec conf-files: split out several helper functions from files_add()
No functional change, preparation for later commit.
2026-01-16 23:01:01 +09:00
Yu Watanabe d207be293c Drop support for SysV rc-local script support
As already announced for several years.
2026-01-16 22:56:28 +09:00
Franck Bui 502d6f4bc9 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).
2026-01-16 14:36:40 +01:00
Daan De Meyer 2e51ed7fcb 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.

Upstream spec change: https://github.com/varlink/varlink.github.io/pull/43
2026-01-16 14:32:43 +01:00
Zbigniew Jędrzejewski-Szmek 3a5b37e162 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.
2026-01-16 14:31:08 +01:00
Luca Boccassi 1bbeb78ea2 manager: add EnqueueMarkedJobs varlink method
Same as the D-Bus method. Returns array of job IDs.
2026-01-16 12:45:48 +00:00
Daan De Meyer 3fa3a4fd15 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.

Fixes #40083
2026-01-16 13:07:47 +01:00
Michael Vogt 3f958812fd sd-boot: allow setting the timeout via SMBIOS 11
Allow configuring the menu timeout used by sd-boot by setting
`io.systemd.boot.timeout=<value>` as SMBIOS type 11 string.

This takes precedence over the setting from the config file
and the EFI var.

Useful for e.g. integration tests that want to control that
a generic image boots faster.
2026-01-16 10:26:48 +01:00
Mike Yuan 5119063196 tree-wide: lock in all memory pages when mlockall() is utilized, and on demand
When employing MCL_FUTURE we don't actually want it to impose
immediate population of malloc()-ed pages. Hence let's set
MCL_ONFAULT everywhere.

Additionally, specify MCL_CURRENT to ensure future memory allocations
on already mapped pages are covered too. (Addresses
https://github.com/systemd/systemd/pull/40319#discussion_r2693726196)

Note that in shutdown the mlockall() is done to avoid keeping swap space
busy, hence a dedicated call w/ MCL_CURRENT and w/o MCL_ONFAULT is made.
2026-01-15 13:56:34 +01:00
Michal Sekletar bcbf80c43d 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.

Fixes #9751
2026-01-15 12:53:50 +01:00
Mike Yuan 1d69e36c44 boot/initrd: fix typo
Follow-up for 80ab99d4d2
2026-01-15 11:36:13 +01:00
Lennart Poettering 80ab99d4d2 efi: use 'struct iovec' more, pass initrds down with it 2026-01-15 11:32:33 +01:00
Yu Watanabe 04f05d9bd7 network: drop fallback logic for kernel older than v5.6
Now our baseline is kernel v5.10.
2026-01-14 16:31:12 +01:00
Zbigniew Jędrzejewski-Szmek 6e78240e64 udev: silence notification failures (#40275)
Closes #39943.
2026-01-14 16:26:00 +01:00
Zbigniew Jędrzejewski-Szmek f2c3ef9678 homectl: add argument comments 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek edd2a2a006 homectl: let drop_from_identity take multiple args
The only functional change should be that we deduplicate arg_identity_filter.
2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek 37ad119451 homectl: trivial simplification 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek ed646a8d47 homectl: split out helpers parse_uid_field
Yet another very similar function, but without generics it's hard to deduplicate
those.
2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek 47f631fda5 homectl: split out helpers parse_{fido2_device,pkcs11_token_uri}_field
Both implement the 'list' verb.
2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek b078b7f055 homectl: split out helper parse_tmpfs_limit_field 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek 3f9c133922 homectl: split out helper parse_capability_set_field 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek 0c2199b4cc homectl: split out helper parse_rebalance_weight 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek a161867b00 homectl: split out helper parse_auto_resize_mode_field 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek ed93b1ed14 homectl: split out helpers parse_{time,timestamp}_field 2026-01-13 17:59:54 +01:00
Zbigniew Jędrzejewski-Szmek 316e9887f2 homectl: split out helper parse_group_field 2026-01-13 17:59:54 +01:00