1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

3567 Commits

Author SHA1 Message Date
Luca Boccassi
2cba2fcd25
Merge pull request #27144 from enr0n/fix-scope-timer-on-coldplug
scope: do not disable timer event source when state is SCOPE_RUNNING
2023-04-14 00:25:06 +01:00
Luca Boccassi
6ef721cbc7 user units: implicitly enable PrivateUsers= when sandboxing options are set
Enabling these options when not running as root requires a user
namespace, so implicitly enable PrivateUsers=.
This has a side effect as it changes which users are visible to the unit.
However until now these options did not work at all for user units, and
in practice just a handful of user units in Fedora, Debian and Ubuntu
mistakenly used them (and they have been all fixed since).

This fixes the long-standing confusing issue that the user and system
units take the same options but the behaviour is wildly (and sometimes
silently) different depending on which is which, with user units
requiring manually specifiying PrivateUsers= in order for sandboxing
options to actually work and not be silently ignored.
2023-04-13 21:33:48 +01:00
Luca Boccassi
ce963a747f
Merge pull request #27244 from bluca/uphold_retry
Uphold/StopWhenUnneeded/BindsTo: add retry timer on rate limit
2023-04-13 21:33:06 +01:00
Nick Rosbrook
af4688398f test: add some tests for RuntimeMaxSec
Make sure the RuntimeMaxSec is applied correctly to service and scope
units when they are started, and also on coldplug.
2023-04-13 15:43:30 -04:00
Luca Boccassi
0607a9f9da systemd-confext: mount confexts as noexec and nosuid
Confexts should not contain code, so mount confexts with noexec.
We cannot mount invidial extensions as noexec, as the overlay ignores
it and bypasses it, we need to use the flag on the whole overlay for
it to be effective.
But given there are legacy scripts still shipped in /etc, allow to
override it with --noexec=false.
2023-04-14 01:21:48 +08:00
Luca Boccassi
4c7a0fc8d0 Uphold/StopWhenUnneeded/BindsTo: requeue when job finishes
When a unit is upheld and fails, and there are no state changes in
the upholder, it will not be retried, which is against what the
documentation suggests.

Requeue when the job finishes. Same for the other two queues.
2023-04-13 13:28:25 +01:00
OMOJOLA JOSHUA DAMILOLA
96ead603b8 systemd-cryptenroll: add string aliases for tpm2 PCRs
Fixes #26697. RFE.
2023-04-13 12:08:32 +01:00
Lennart Poettering
39857544ee
Merge pull request #27027 from dtardon/unit-file-list-cleanup
Use _cleanup_ for UnitFileList hash
2023-04-13 09:10:17 +02:00
Lennart Poettering
3540ce8587 test: validate that fdstore pinning works 2023-04-13 06:44:27 +02:00
David Tardon
e7f5525fb0 test: also test client-side operation if applicable 2023-04-12 17:14:06 +02:00
Lennart Poettering
3af48a86d9
Merge pull request #25608 from poettering/dissect-moar
dissect: add dissection policies
2023-04-12 13:46:08 +02:00
Luca Boccassi
068943453f
Merge pull request #27165 from poettering/fdstore-envvar
service: tell service processes that the fdstore is available via an e…
2023-04-12 12:13:43 +01:00
Daan De Meyer
ea24ed79f6
Merge pull request #27220 from yuwata/sd-device-follow-ups-for-devlink
sd-device: several follow-ups about devlink creation
2023-04-12 11:49:08 +02:00
Lennart Poettering
75b29fda71 service: tell service processes that the fdstore is available via an env var 2023-04-12 10:34:31 +02:00
Yu Watanabe
7e430500d2 udev-test: add more testcases for SYMLINK 2023-04-12 10:52:14 +09:00
Frantisek Sumsal
82929336c7 test: drop binary stripping stuff
Stripping the binaries in the test images makes potential stack straces
quite useless, so let's drop the stripping stuff to make test fails a bit
more developer friendly.

Related: https://github.com/systemd/systemd-centos-ci/pull/616
2023-04-12 10:33:32 +09:00
Daan De Meyer
73c43e96e7
Merge pull request #27186 from yuwata/os-release
os-util: several cleanups and introduce _at() variants of os-release parsers
2023-04-11 14:54:56 +02:00
Zbigniew Jędrzejewski-Szmek
ba5a469648
Merge pull request #27169 from yuwata/udev-rule-refuse-unsafe-path
sd-device,udev: refuse unsafe path in SYMLINK= and TAG=
2023-04-11 14:43:50 +02:00
Yu Watanabe
5cf69e709e os-util: make $SYSTEMD_OS_RELEASE prefixed with the root directory
To make it consistent with other env vars, e.g. $SYSTEMD_ESP_PATH or
$SYSTEMD_XBOOTLDR_PATH.

This is useful when the root is specified by a file descriptor, instead
of a path.
2023-04-11 18:49:23 +09:00
Yu Watanabe
adc5b9823c test: update description 2023-04-11 06:07:15 +09:00
Yu Watanabe
6fdc9fbc0f udev/scsi_id: rename positional arguments 2023-04-11 06:07:03 +09:00
Luca Boccassi
1dec1c6163
Merge pull request #27182 from mrc0mmand/test-tweaks
test: a couple of stability tweaks
2023-04-10 18:42:34 +01:00
Yu Watanabe
32cc2cfac9 test: add another regression test
For #27187, which should be also caused by #26956.
2023-04-10 05:43:09 +09:00
Yu Watanabe
1538136911 test: systemd-analyze blame should succeed now 2023-04-10 05:34:30 +09:00
Frantisek Sumsal
9acb7ee425 test: check if we skip the full setup on daemon-reexec (again)
My original assumption in 61961e693d was wrong, since we do reset
/dev/console during reexec (see make_console_stdio()), so the test was
quite racy. Let's replace it with something, hopefully, more reliable.

Follow-up to 61961e693d.
2023-04-08 13:55:29 +09:00
Yu Watanabe
18a6cd4ba3 test-64: add tests for compat devlinks for NVMe drive 2023-04-08 06:12:29 +09:00
Yu Watanabe
0b4c70b47a sd-device,udev: tag must be a valid filename
All tags are managed under /run/udev/tags, and the directories there are
named with tags. Hence, each tag must be a valid filename.

This also makes all validity check moved to sd-device side, and
makes failure caused by setting invalid tags non-critical.

With this change, an empty string cannot be assigned to TAG=, hence the
test cases are adjusted.
2023-04-08 04:49:46 +09:00
Yu Watanabe
2c5f119c3c sd-device,udev: refuse invalid devlink and store in normalized form
This is especially for the case that the path contains "..".
Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858.

This also makes SYMLINK= gracefully handle paths prefixed with "/dev/",
and manage devlink paths with path_hash_ops.
2023-04-08 03:38:19 +09:00
Frantisek Sumsal
cb58571a11 test: bump the timeout for non-qemu runs to 90s
When Ubuntu CI is oversaturated, 60s doesn't seem to be enough.
2023-04-07 17:23:59 +02:00
Frantisek Sumsal
6de6376075 test: enable the systemd-resolved unit in TEST-75
Without enabling itx, there's no symlink to the org.freedesktop.resolve1
dbus service, so there exists a tiny window in which the sequence of
`systemctl start` and `systemctl service-log-level` commands might fail:

[ 1127.615151] H systemd[1]: Started Network Name Resolution.
[ 1127.617768] H testsuite-75.sh[34]: + systemctl service-log-level systemd-resolved.service debug
[ 1127.621251] H dbus-daemon[54]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.24' (uid=0 pid=119 comm="systemctl service-log-level systemd-resolved>
[ 1127.621336] H systemd[1]: dbus-org.freedesktop.resolve1.service: Failed to load configuration: No such file or directory
[ 1127.621364] H systemd[1]: dbus-org.freedesktop.resolve1.service: Trying to enqueue job dbus-org.freedesktop.resolve1.service/start/replace
[ 1127.621395] H systemd[1]: D-Bus activation failed for dbus-org.freedesktop.resolve1.service: Unit dbus-org.freedesktop.resolve1.service not found.
[ 1127.621965] H dbus-daemon[54]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
[ 1127.622046] H systemd[1]: systemd-resolved.service: D-Bus name org.freedesktop.resolve1 now owned by :1.25
[ 1127.622130] H systemctl[119]: Failed to set log level of org.freedesktop.resolve1 to debug: Unit dbus-org.freedesktop.resolve1.service not found.

Spotted in a couple of recent Ubuntu CI runs.
2023-04-07 17:00:10 +02:00
Zbigniew Jędrzejewski-Szmek
1e094cb4ba
Merge pull request #27126 from yuwata/journal-compress
sd-journal: allow to specify compression algorithm through env
2023-04-07 09:28:27 +02:00
Yu Watanabe
0864b5eb6e
Merge pull request #27158 from mrc0mmand/more-tests
test: introduce TEST-81-GENERATORS
2023-04-07 07:53:37 +09:00
Frantisek Sumsal
61961e693d test: check if we skip the full setup on daemon-reexec
A simple test case for issue #27106.

Resolves: #27139
2023-04-07 07:53:14 +09:00
Yu Watanabe
d23a1c52a9 test: add test case that journal file is created with the requested compression algorithm 2023-04-07 02:30:43 +09:00
Frantisek Sumsal
17c9dbc98b test: introduce TEST-81-GENERATORS
Add some explicit tests for various generators we ship, e.g.:
    - systemd-debug-generator
    - systemd-environment-d-generator
    - systemd-fstab-generator
2023-04-06 13:16:40 +02:00
Frantisek Sumsal
9948a169c0 test: add a couple of tests for systemd-modules-load 2023-04-06 10:26:47 +02:00
maanyagoenka
c3c6a4f0a9 confext: add tests for systemd-confext 2023-04-05 21:50:04 +00:00
Franck Bui
f9a23d428a test: use kbd-mode-map we ship in TEST-73-LOCALE
The rational is the same as the one described in commit
be0cc2ce6c947aafadb3f42dba405269f670b31c.
2023-04-05 19:58:57 +01:00
Lennart Poettering
f1f42aeaf1 test: add integration test for image policy 2023-04-05 20:54:30 +02:00
Lennart Poettering
a62e12dad1 analyze: add 'image-policy' tool for analyzing image dissection policies 2023-04-05 20:51:31 +02:00
Thomas Blume
d6d0661631 test/test-functions: fix typo in install_suse_systemd() 2023-04-04 20:39:11 +01:00
Dmitry V. Levin
56df2f6f9b udev-rules: check tokens order
When invoked by udevadm verify, warn about rules that have PROGRAM
assignments specified after RESULT checks.
2023-04-03 23:44:26 +09:00
Lennart Poettering
6b868766eb
Merge pull request #27044 from bluca/sysext_recursive_dir
Ensure sysexts do not contain an os-release file, do not load sysexts from /usr[/local]/lib/extensions/
2023-04-03 12:38:48 +02:00
Frantisek Sumsal
2e4f69946c
Merge pull request #27087 from mrc0mmand/missing-coverage
test: set ReadWritePaths= for test-.services when built w/ coverage
2023-04-01 18:59:42 +02:00
Frantisek Sumsal
9fd8226312 test: shed some light into the whole coverage situation 2023-04-01 12:15:42 +02:00
Daan De Meyer
05eb2c60bd firstboot: Add --reset option
This can be used to prepare an image for firstboot by removing all
files that systemd knows about that contain machine specific
information.
2023-04-01 10:50:15 +02:00
Dmitry V. Levin
e873a9f18a treewide: fix unnecessary $ on arithmetic variables
This should fix shellcheck warning SC2004.
2023-04-01 01:48:44 +08:00
Frantisek Sumsal
e660c590a5 test: set ReadWritePaths= for test-.services when built w/ coverage
Let's make the dropin, to make the build dir writable for gcov, a bit
more generic, so it can be used by all units starting with prefix test-.
This should help with a bunch of recent reports about missing coverage I
got, as well as with existing test units using DynamicUser=true.

This might feel a bit like a magic trick from behind the curtains, but I
want to touch the actual tests as little as possible, since it makes them
unnecessarily messy (see the various workarounds for sanitizers), and
the coverage reports are generated only in a specific CI job anyway.
2023-03-31 19:23:31 +02:00
OMOJOLA JOSHUA DAMILOLA
27d45db38c test: fixed negative checks in TEST-70-TPM2.
Use in-line error handling rather than redirections. Follow up on #27020
2023-03-31 17:50:59 +01:00
Thomas Blume
c7bf1959d7 test: use setpriv instead of su for user switch from root
systemd-repart needs to find mkfs.ext4 for the test.
This is located in the directory /usr/sbin on openSUSE Tumbleweed.
But since the variable ALWAYS_SET_PATH in /etc/login.defs is set to yes,
su re-initializes the $PATH variable and removes /usr/sbin.
Hence, mkfs.ext4 is not found and the test fails.
Using setpriv instead of su fixes this issue and is more appropriate to
do the switch user task from root.

[zjs: move setpriv to $BASICTOOLS and force-push to retrigger CI]
2023-03-31 22:26:44 +08:00