1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-04 09:18:12 +03:00
Commit Graph

78229 Commits

Author SHA1 Message Date
maia x.
fbd2c51533 test: check reloading notify-reload service refreshes vpick extensions 2024-12-19 12:57:03 -08:00
maia x.
043a6609b1 mkosi: add socat to minimal-0/1 images
Include 'socat' as part of the tools built with minimal-0/minimal-1
images used for integration testing. This would allow notify-reload
services to signal reloading without using the systemd-notify tool
and other socket communication test cases.
2024-12-19 12:57:03 -08:00
maia x.
4c896a7c71 core: reload confexts when reloading notify-reload services
`ExtensionImages=` and `ExtensionDirectories=` now let you specify vpick-named
extensions; however, since they just get set up once when the service is
started, you can't see newer versions without restarting the service entirely.
Here, also reload confext extensions when you reload a service. This allows you
to deploy a new version of some configuration and have it picked up at reload
time without interruption to your workload.

Right now, we would only reload confext extensions and leave the sysext ones
behind, since it didn't seem prudent to swap out what is likely program code at
reload. This is made possible by only going for the
`SYSTEMD_CONFEXT_HIERARCHIES` overlays (which only contains `/etc`). For now, we
also only do this for the notify-reload service type until more knobs are added
in the future.
2024-12-19 12:57:03 -08:00
maia x.
6f0c327f3a vpick: add path_uses_vpick helper method
Add a path_uses_vpick helper method to determine if a path matches
the vpick format ('PATH/NAME.SUFFIX.v' or 'PATH.v/NAME___.SUFFIX').
2024-12-19 12:57:02 -08:00
Ivan Kruglov
3cbf00a30c machine: make TEST-13-NSPAWN wqlong-running code more verbose
Need this to debug https://github.com/systemd/systemd/issues/35115
2024-12-19 17:09:04 +00:00
Luca Boccassi
0f67cb3606
Minor fixes in man pages, example scripts, error log (#35683)
No functional changes.
2024-12-19 17:08:13 +00:00
Matthias Lisin
6e3f32cc56
man/sysupdate.features: fix typos 2024-12-19 12:39:32 +01:00
Matthias Lisin
1462736c7e
sysupdate: fix args order of formatted error 2024-12-19 12:39:31 +01:00
Matthias Lisin
f441831c9e
man/sysupdate.d: fix wrong PathRelativeTo value 2024-12-19 12:39:31 +01:00
Matthias Lisin
4bc06da775
man: fix args order for udevadm info cmd 2024-12-19 12:39:31 +01:00
Yu Watanabe
b5ea69f5ac
udev: move config parsers and related things to udev-config.c (#35624)
No functional change, just refactoring and preparation for later
changes.
2024-12-19 18:41:52 +09:00
Yu Watanabe
04fa5c1580 udev-config: introduce UdevConfig
Then, save configurations by their source: udev.conf, command line
arguments, kernel command line options, and udev control.

Preparation to support reloading udev.conf in a later commit.
2024-12-19 12:28:44 +09:00
Yu Watanabe
394a678aec udev: move parsers for config file, kerenel command line, and positional arguments to udev-config.c
No functional change, just refactoring and preparation for later
commits.
2024-12-19 12:28:44 +09:00
Thomas Hebb
32c3e1379d ukify: Fix regression in --no-sign-kernel flag
The man page says that --sign-kernel and --no-sign-kernel "override the
detection of whether to sign the Linux binary", so we should only
autodetect if neither are specified. But as of commit 02eabaffe9
("ukify: Add a unified interface for signing tools"), we autodetect even
when --no-sign-kernel is passed, which makes the flag useless.

The sign_kernel option is parsed using argparse.BooleanOptionalAction,
which sets it to either True, False, or None. commit 02eabaffe9
replaced `sign_kernel is None` with `not sign_kernel`. These are not the
same in Python, as the latter accepts False as well as None.

Restore the original check and fix type annotations accordingly.

Fixes: 02eabaffe9 ("ukify: Add a unified interface for signing tools")
2024-12-19 12:27:27 +09:00
Lennart Poettering
0d1ebcf67d
networkd-sysctl: tweak error handling and log level a bit (#35673) 2024-12-18 18:20:30 +01:00
Mike Yuan
cffae6e113
networkd-sysctl: tweak error handling and log level a bit
Follow-up for 6d9ef22acd

- Downgrade log level for bpf not installed or kernel version
  being too old to LOG_DEBUG. Otherwise, on kernels older than 6.12
  the log becomes quite annoying.
- Always propagate the error and ignore only on caller's side.
  The current style is a messy mix.
2024-12-18 16:38:54 +01:00
Daan De Meyer
a48803fd84 man: Document generator sandbox environment 2024-12-19 00:36:52 +09:00
Mike Yuan
22583a002e
networkd-sysctl: rename functions to match our typical prefixes 2024-12-18 16:36:24 +01:00
Yu Watanabe
be1bcb85ce
ptyfwd: several cleanups (#35663) 2024-12-19 00:35:42 +09:00
Yu Watanabe
85d040dabd update-utmp: do not give up if the first attempt at connecting bus failed
Otherwise, the program exits with failure if the first attempt in run() failed:
```
Dec 18 20:27:37 systemd-update-utmp[254]: Bus n/a: changing state UNSET → OPENING
Dec 18 20:27:37 systemd-update-utmp[254]: sd-bus: starting bus by connecting to /run/systemd/private...
Dec 18 20:27:37 systemd-update-utmp[254]: Bus n/a: changing state OPENING → CLOSED
Dec 18 20:27:37 systemd-update-utmp[254]: Failed to get D-Bus connection: Connection refused
```
2024-12-19 00:34:38 +09:00
Yu Watanabe
67e5622bfe TEST-50-DISSECT: notify message cannot be sent by ncat
Follow-up for d0a63cf041.

The command ncat may be already dead when the service manager receives
the notify message. Hence, the service cannot be found by the sender PID,
and the notify message will be ignored.
```
Dec 17 03:26:49 systemd[1]: Cannot find unit for notify message of PID 1159, ignoring.
Dec 17 03:26:49 systemd[1]: Received SIGCHLD from PID 1152 (bash).
Dec 17 03:26:49 systemd[1]: Child 1152 (bash) died (code=exited, status=0/SUCCESS)
Dec 17 03:26:49 systemd[1]: run-p1151-i1451.service: Child 1152 belongs to run-p1151-i1451.service.
Dec 17 03:26:49 systemd[1]: run-p1151-i1451.service: Main process exited, code=exited, status=0/SUCCESS (success)
Dec 17 03:26:49 systemd[1]: run-p1151-i1451.service: Failed with result 'protocol'.
Dec 17 03:26:49 systemd[1]: run-p1151-i1451.service: Service will not restart (restart setting)
Dec 17 03:26:49 systemd[1]: run-p1151-i1451.service: Changed start -> failed
```

This also drops unnecessary --pipe option and redundant check by 'env' command.
2024-12-18 15:50:02 +01:00
Morten Hauke Solvang
0da73fab56 resolved: if one transaction completes, expect other transactions within candidate to succeed quickly
Fixes #22575, as suggested by poettering in #35514.

Intended as a workaround for some buggy routers, which refuse to send empty
replies. If systemd-resolved starts two DnsTransactions, one for A and one
for AAAA, and the domain in question has no AAAA entry, then the server will
send a reply for A and no reply for AAAA. Correct behavior for the server would
be to send an empty reply for AAAA.

systemd-resolved would previously keep retrying the AAAA transaction, and
eventually timeout the whole query, returning an error to the caller.

Now, if the server replies to one query and not another, we cut short the
timeout and return the partial result. Returning the partial result allows
the rest of the system to keep working. It matches how e.g. glibc libnss_dns
behaves.
2024-12-18 15:43:46 +01:00
Daan De Meyer
1152826e8d test-firewall-util: Migrate to new assertion macros 2024-12-18 22:03:05 +09:00
Yu Watanabe
d6d98a0c01
udev: make builtins take UdevEvent object (#35625)
No functional change, just refactoring.
2024-12-18 22:02:22 +09:00
Yu Watanabe
114453d795 data-fd-util: drop dead code
Also drops unnecessary header inclusions.

Follow-ups for a87a9625f8.
Fixes CID#1568419.
2024-12-18 13:47:35 +01:00
Fabian Vogt
e61032bf47 tpm2-util: Also retry unsealing after policy_pcr returns PCR_CHANGED
It's not just Esys_Unseal that may fail due to PCR changes during the
session, but also Esys_PolicyPCR. Perform a retry in that case as well.

Fixes #35490
2024-12-18 13:34:55 +01:00
Lennart Poettering
9aee971185 tree-wide: use pidref_is_self() at more places 2024-12-18 13:34:35 +01:00
Yu Watanabe
64b504bde3 machinectl: explicitly assign PTY forwarder to sd_bus_slot
No functional change, just refactoring.
2024-12-18 20:28:28 +09:00
Yu Watanabe
12807b5a49 ptyfwd: always flush buffer and disconnect before exit
Then, it is not necessary to manually drain PTY forwarder by the user
side. Also, not necessary to free PTY forwarder earlier explicitly to
make it disconnected.
2024-12-18 20:28:07 +09:00
Yu Watanabe
4a4e7ec0e9 ptyfwd: always write additional line break on stop
Currently we do that in the user of PTY forwarder, e.g. nspawn.
But, let's do that unconditionally in the PTY forwarder.
2024-12-18 20:26:58 +09:00
Yu Watanabe
d517427dff ptyfwd: save the last character before the escape sequence
If we write e.g. a line break and CSI sequence, then it is not necessary
to write another line break on exit.
2024-12-18 19:55:46 +09:00
Yu Watanabe
5e6a48bf99 ptyfwd: do not forward partial escape sequence
Otherwise, if the sender is killed while writing escape sequence,
we may get spurious output.
2024-12-18 19:55:37 +09:00
Yu Watanabe
781c8c3f72 ptyfwd: coding style fix
- replace 'type *func()' -> 'type* func()',
- rename output argument to 'ret'.
2024-12-18 19:45:46 +09:00
Michal Koutný
4c9f242a54 mkosi: Fix tools image package name 2024-12-18 11:08:06 +01:00
Lennart Poettering
7a8556b901
confext/sysext: add initrd-specific units (#35426)
In the rootfs these need to run after /var/lib/ has been set up. In the
initrd we want them to run as soon as possible so that they can be used
to customize setting up the rootfs.
2024-12-18 10:33:38 +01:00
Yu Watanabe
5830d34b40 core: drop unnecessary header inclusion
Follow-up for e76fcd0e40.
2024-12-18 09:30:25 +01:00
Yu Watanabe
80080f34f3 TEST-07-PID1: fix typo
Follow-up for e76fcd0e40.
2024-12-18 10:46:51 +09:00
Lennart Poettering
4f6086ceb4
pam_systemd: some refactorings and bugfixes (#35178)
Inspired at #35171 I had another closer look at pam_systemd, and found a
bunch of things to fix, and correct.
2024-12-17 23:02:00 +01:00
Lennart Poettering
be883be6d3
remove fallbacks for memfd-less kernels (#35605)
Let the culling continue: let's remove support for kernels that lack
memfd, i.e. pre-3.17 kernels.

This is a nice simplification of things.
2024-12-17 23:01:29 +01:00
Nick Rosbrook
96c4d9d94d test: skip TEST-69-SHUTDOWN on ubuntu too 2024-12-17 19:04:04 +00:00
Lennart Poettering
3ee8082947 update TODO 2024-12-17 18:26:15 +01:00
Lennart Poettering
6db5a6e799 doc: document new baseline requires memfd_create() 2024-12-17 18:26:15 +01:00
Lennart Poettering
4dac692094 fuzz-journal-remote: use memfd_new_and_seal() where appropriate
This means we can drop memfd_new_and_map() and results in generally
shorter code.
2024-12-17 18:26:15 +01:00
Lennart Poettering
65d9ef40f2 pid1: drop check that ensures /run/ has plenty space before reexec/reload
Now that we only support serialization into a memfd (rather than a file
in /run/) there's no point to check the free space in /run/. Let's drop it.

One error scenario gone. Yay.
2024-12-17 18:26:15 +01:00
Lennart Poettering
d54bbc4cdc memfd-util: trivial modernizations 2024-12-17 18:26:15 +01:00
Lennart Poettering
5d1e57b820 serialize: add explicit calls for finishing serialization
These new calls will do three things:

1. in case of FILE* stuff: flush any pending bytes onto the fd, just in
   case
2. seal the backing memfd
3. seek back to the beginning.

Note that this adds sealing to serialization: once we serialized fully,
we'll seal the thing off for further modifications, before we pass the
fd over to the target process. This should add a bit of robustness, and
maybe finds a bug or two one day, if we accidentally write to a
serialization that is complete.
2024-12-17 18:26:15 +01:00
Lennart Poettering
4d98709cb2 memfd-util: introduce memfd_new_full() helper
This is just like memfd_new(), but allows fine grained control of the
sealing flags.

This switches over all uses of memfd_new() where we actually want
sealing to use memfd_new_full().

This then allows use to use memfd_new() for two further calls, where we
previously used the more lowlevel memfd_create_wrapper().
2024-12-17 18:26:15 +01:00
Lennart Poettering
9b1d97cccd memfd-util: explain what memfd_create_wrapper() is for in a comment 2024-12-17 18:26:15 +01:00
Lennart Poettering
caf1436ee8 memfd-util: use TASK_COMM_LEN at one more place
Note this corrects the size of the array from 17 to 16, as the 16
already includes space for a trailing NUL.
2024-12-17 18:26:15 +01:00
Lennart Poettering
ce66a2f2bb sd-journal: drop memfd fallback 2024-12-17 18:26:15 +01:00