Commit Graph
80009 Commits
Author SHA1 Message Date
Lennart Poettering a9178dbdd9 cgroup-util: Handle capsule@ paths like user@ paths (#36664)
The capsule instances are related to user instances, so treat them
equally to user@.service when handling cgroup paths. This also saves us
from polluting public libsystemd API with variant for capsules too.

Fix: https://github.com/systemd/systemd/issues/36098
2025-03-11 12:03:57 +01:00
Lennart Poettering f8a09ace1d core/service: introduce sd_notify() RESTART_RESET=1 for resetting restart counter (#36698) 2025-03-11 12:03:12 +01:00
Mike Yuan fce19eb67f core/main: fix logging of /sbin/init exec failure
Follow-up for 93e19483dc

While at it, avoid duplicate manager_status_printf()
(error_message will be shown in main()).
2025-03-11 12:02:57 +01:00
Yu Watanabe b8790a875e tmpfiles: ignore ENOENT when file is removed during setting parmission and friends
After a file matches with a glob pattern, the file may be removed or
renamed before opening it. Let's ignore the error in such case.

Fixes #30938.
2025-03-11 18:52:28 +09:00
Lennart Poettering a0d8484eeb update TODO 2025-03-11 10:48:40 +01:00
Yu Watanabe 2373397c41 udev: reread partition table and trigger synthetic change events in child process (#36685) 2025-03-11 18:43:43 +09:00
Michal Koutný 6c5703f9bc cgroup-util: Handle capsule@ paths like user@ paths
The capsule instances are related to user instances, so treat them
equally to user@.service when handling cgroup paths. This also saves us
from polluting public libsystemd API with variant for capsules too.

Fix: #36098
2025-03-11 10:37:19 +01:00
Mike Yuan c139ac7f53 TODO: support RESTART_RESET=1 in journal-upload 2025-03-11 00:44:44 +01:00
Mike Yuan 406aeb5da6 core/service: introduce sd_notify() RESTART_RESET=1 for resetting restart counter
We have RestartMaxDelaySec= + RestartSteps= to exponentially increase
auto restart durations, but it currently cannot be reset by the service
itself, which makes it sometimes awkward to use. A typical pattern
in real life is that a service was once down (e.g. due to temporary
network interruption) and multiple restarts were attempted. Then,
future restarts would always wait for increated amount of time based on
RestartMaxDelaySec=, even after the original problem got resolved.
Such "persistence" could result in longer unavailablity than there
should be for failures that come later.
(C.f. https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdResettingUnitBackoff)

Let's introduce a new sd_notify() notification for resetting the restart
counter. There were discussions about making this timer-based, but I think
it's more flexible to leave the decision-making to the service. This enables
them to do a combination of N successful requests + uptime check for instance.
2025-03-11 00:44:44 +01:00
Mike Yuan a364ebd46d core/unit: disable unit debug invocation in generic unit_reset_failed() 2025-03-10 23:59:31 +01:00
Yu Watanabe bb3ad7b2f1 udev: use ERRNO_IS_NEG_* where appropriate (#36690)
Follow-up for f8825c1364.
2025-03-10 23:51:41 +01:00
Yu Watanabe 9c47b1527e udev: scan partitions and trigger synthetic change events in child process
Rereading partition table may take longer on slow disk. The main process
should not be blocked by the operation. Let's fork a child process and
do that on the child.

Prompted by #36624 and #36269.
2025-03-11 05:55:51 +09:00
Yu Watanabe ee9ff3902b udev: split out synthesize_change_all() from synthesize_change()
No functional change. Preparation for later change.
2025-03-11 05:55:51 +09:00
Antonio Alvarez Feijoo cef2181cda umount: do not move busy network mounts
If a network mount returns EBUSY on umount, the logic introduced in
6dc68a00cf causes shutdown to hang indefinitely on
`fstatat()` (i.e., within `is_dir(m->path, true)`). Hence, skip this logic for
network mounts (following the same motivation we use to skip read-only mounts in
this kind of file systems).

Fixes 6dc68a00cf
2025-03-11 05:53:31 +09:00
Yu Watanabe 63b331517e nsresourced,vmspawn,mountfsd: various smaller fixes (#36689) 2025-03-11 05:50:04 +09:00
Yu Watanabe c24148451a event-util: move event_source_hash_ops to event-util 2025-03-11 05:48:19 +09:00
Lennart Poettering abec5cdd56 nsresourced,mountfsd: set userdata pointer via varlink_server_new() 2025-03-10 16:41:45 +01:00
Lennart Poettering 0d4f38732b vmspawn: properly exit in vmspawn child on failure 2025-03-10 16:41:43 +01:00
Lennart Poettering e267f42d91 nsresourced: fix initialization of netns_fd_idx 2025-03-10 16:41:40 +01:00
Lennart Poettering 5dc4a3f4c2 nsresourced: clear up some type confusion
We settle on the types the backend implementation in
userns-registry.[ch] uses too. i.e. uid_t/gid_t for the bases, and
uint32_t for the uid range sizes.
2025-03-10 16:41:38 +01:00
Lennart Poettering b74a554def nsresourced: permit numeric uid/gid also be specified as strings 2025-03-10 16:41:36 +01:00
Lennart Poettering 869bf7282b nsresourced: fix offset
Follow-up for: ee6fd7ef82
2025-03-10 16:41:33 +01:00
NetSysFire 1f0e4af329 systemd.exec(5): RestrictAddressFamilies: mention address_families(7) 2025-03-11 00:00:55 +09:00
Yu Watanabe a5c11722e6 run: declare ARG_STDIO_XYZ like a flag
Then, we can easily handle the assignment when both --pipe and
--pty/--pty-late are specified.
No functional change, just a refactoring.
2025-03-10 22:34:52 +09:00
Yu Watanabe ad338e0fd5 vmspawn: fix typo
Follow-up for ef430b84e9.
2025-03-10 18:12:51 +09:00
Yu Watanabe 2792b1181f meson: bump required minimum version to 0.62.0 (#36610)
- bump the requred minimum version of meson to 0.62.0,
- use install_symlink(), which is supported since meson-0.61.0,
- use more features provided by newer meson with careful
conditionalization.

Follow-up for 8442ac9c02.
Closes #35967.
2025-03-10 07:51:28 +09:00
Matteo Croce f06e6d19c0 network: add log messages when a route can't be updated
Sometimes networkd removes a route, based on route_can_update() verdict.
Add some debug messages to better understand whi this decision has been made.
2025-03-10 05:39:49 +09:00
Mike Yuan 8d04b8198d docs: reference cgroup v1 as historical and unsupported 2025-03-10 05:24:19 +09:00
Lennart Poettering ef430b84e9 vmspawn: optionally grow image 2025-03-10 03:57:46 +09:00
Yu Watanabe 37cfab0e82 po: update Japanese translations 2025-03-10 03:35:54 +09:00
Yu Watanabe e2ea2d1349 man: fix typo
Follow-ups for fd0dd2d4bc.
2025-03-10 03:23:47 +09:00
Yu Watanabe 51c086b9cc meson: use more features provided by newer meson
No functional change. Preparation for future bump of required meson
version.
2025-03-10 02:41:40 +09:00
Yu Watanabe c0cc01de8a meson: use install_symlink() where applicable
Now our baseline of meson is 0.62, hence install_symlink() can be used.

Note, install_symlink() implies install_emptydir() for specified
install_dir. Hence, this also drops several unnecessary
install_emptydir() calls.

Note, the function currently does not support 'relative' and 'force' flags,
so several 'ln -frsT' inline calls cannot be replaced.
2025-03-10 02:41:40 +09:00
Yu Watanabe ff697bb909 meson: invert version check condition to magically suppress warning
Then, it works with --fatal-meson-warnings.
2025-03-10 02:41:40 +09:00
Yu Watanabe 5506aff98d test-network: replace symlink to 99-default.link with a copy
Then, we can drop ugly workaround in meson.build.
The .link file is not necessarily synced with 99-default.link.
Also, 99-default.link is not updated so frequently.
Let's manually sync it when necessary.
2025-03-10 02:41:40 +09:00
Yu Watanabe a030f8cc94 meson: bump required minimum version to 0.62.0
The commit 8442ac9c02 set
install_tag option to install_emptydir() calls, but it requires
meson-0.62.0. Hence, after the commit, we cannot build systemd
with older meson anymore. As using install_tag is quite useful
for building systemd package, let's bump the requirement of
meson version to 0.62.0.

Note, the current meson versions of major distributions are:
CentOS 9:  0.63.3
CentOS 10: 1.4.1
Fedora 40: 1.4.1
Fedora 41: 1.5.1
Ubuntu 20.04 LTS (focal): 0.53.2 -- EOL on 2025-04
Ubuntu 22.04 LTS (jammy): 0.61.2 -- EOL on 2027-04
Ubuntu 24.04 LTS (noble): 1.3.2
Ubuntu 24.10 (oracular):  1.5.2
Debian 11 (bullseye): 0.56.2 (1.0.0 in backports) -- EOL on 2024-08
Debian 12 (bookworm): 1.0.1  (1.5.1 in backports)
openSUSE Leap 15.6:  1.6.1
openSUSE Tumbleweed: 1.6.1

As the next version (v258) is not expected to be released before
the end of 2025-04, it is OK to cut the support of Ubuntu 20.04 LTS and
Debian 11. Also, our policy for support of distributions explicitly says
only latest Ubuntu LTS and non-LTS releases are supported.
Hence, we can also cut Ubuntu 22.04, even if it is not EOL.

Follow-up for 8442ac9c02.
Closes #35967.
2025-03-10 02:41:40 +09:00
Piotr Drąg e645246c8d po: add false positives to POTFILES.skip
Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect these files as containing translations. Avoid this
behavior by putting the files in POTFILES.skip.
2025-03-09 11:38:47 +00:00
Henri Aunin ef19119780 po: Translated using Weblate (Estonian)
Currently translated at 79.3% (204 of 257 strings)

Co-authored-by: Henri Aunin <contact+fedora@hen.ee>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/et/
Translation: systemd/main
2025-03-09 11:54:56 +09:00
Yu Watanabe a5ede71f49 mount-setup: two trivial cleanups (#36668) 2025-03-09 09:42:41 +09:00
Yu Watanabe a22ba8cdd7 core/main: several cleanups (#36669)
Prompted by #36622
2025-03-09 09:40:19 +09:00
H A 989f39e8b0 po: Translated using Weblate (Estonian)
Currently translated at 61.4% (158 of 257 strings)

Co-authored-by: H A <contact+fedora@hen.ee>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/et/
Translation: systemd/main
2025-03-09 08:36:23 +09:00
Mike Yuan 590e0e3bac core/main: correct retval for reexec/switch-root/soft-reboot
For these objectives we ought to execve() at the end, i.e. if we
ever hit the return path something went wrong in do_reexecute().
Let's properly report that via retval.
2025-03-08 20:49:30 +01:00
Mike Yuan 93e19483dc core/main: preemptively check existence of init only if we're switching root
Follow-up for aaa27e2e21

The commit described about system potentially becoming undebuggable
after switching into broken root or whatnot. But notably we can never
activate emergency.target after do_reexecute() failure, since the Manager
has been destructed. Plus, for a normal reexecution the fallback shell logic
triggered on non-existent /sbin/init is kinda useful. Let's hence guard
the extra check behind switch-root.

Also, move the check below /run/nextroot/ detection.
2025-03-08 20:49:30 +01:00
Mike Yuan 550f4718bc core/main: assign mac_init() retval to r
If it fails, we'd submit the errno to supervisor via sd_notify() later.
2025-03-08 20:40:24 +01:00
Mike Yuan eda75b2cb2 core/main: log about save_env() error 2025-03-08 20:40:24 +01:00
Mike Yuan 0ddf4acab4 core/main: port to log_syntax_parse_error() 2025-03-08 20:40:24 +01:00
Mike Yuan fafb05451f core: move CrashAction enum def to crash-handler.[ch] 2025-03-08 20:40:23 +01:00
Mike Yuan 568bafca50 core/meson: move efi-random.c out of libcore
It's used only in core/main.c
2025-03-08 20:40:23 +01:00
Mike Yuan 5fe2b509aa core/main: remove unused include 2025-03-08 20:40:23 +01:00
Mike Yuan b05c495eed mount-setup: tune down log level if usrquota is not supported, apply usrquota when smack is in use too
Follow-up for 8f5131fb9e
2025-03-08 19:16:17 +01:00