]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agotest-execute: prominently show which test we are about to enter 36719/head
Lennart Poettering [Thu, 13 Mar 2025 10:49:13 +0000 (11:49 +0100)] 
test-execute: prominently show which test we are about to enter

7 months agoexecute: add some minor debug logging
Lennart Poettering [Thu, 13 Mar 2025 10:43:08 +0000 (11:43 +0100)] 
execute: add some minor debug logging

7 months agopid1: don't connect to oomd in test runs
Lennart Poettering [Thu, 13 Mar 2025 10:13:44 +0000 (11:13 +0100)] 
pid1: don't connect to oomd in test runs

7 months agoanalyze: don't connect to bus from analyze test run
Lennart Poettering [Wed, 12 Mar 2025 17:19:34 +0000 (18:19 +0100)] 
analyze: don't connect to bus from analyze test run

This thing should not be "live", hence don't try to connect to the bus,
or bind the private bus socket.

Fixes: #36540
7 months agomanager: explicitly create our private runtime directory
Lennart Poettering [Thu, 13 Mar 2025 10:43:46 +0000 (11:43 +0100)] 
manager: explicitly create our private runtime directory

So far /run/systemd/ was created as side-effect of initializing the
D-Bus client/server. But in one of the next commits we'll suppress
connecting to D-Bus in test runs, hence let's move the logic our of the
D-Bus code and into manager_startup().

Then, also drop creating it again and again in PID 1 at various places,
and just rely on it to exist.

7 months agocoredump,analyze: use read_full_file() for reading various top-level /proc/ files
Lennart Poettering [Thu, 13 Mar 2025 08:30:23 +0000 (09:30 +0100)] 
coredump,analyze: use read_full_file() for reading various top-level /proc/ files

Kernel API file systems typically use either "raw" or "seq_file" to
implement their various interface files. The former are really simple
(to point I'd call them broken), in that they have no understanding of
file offsets, and return their contents again and again on every read(),
and thus EOF is indicated by a short read, not by a zero read. The
latter otoh works like a typical file: you read until you get a
zero-sized read back.

We have read_virtual_file() to read the "raw" files, and can use regular
read_full_file() to read the "seq_file" ones.

Apparently all files in the top-level /proc/ directory use 'seq_file'.
but we accidentally used read_virtual_file() for them. Fix that.

Also clarify in a comment what the rules are.

Fixes: #36131
7 months agobootctl: make sure bootctl --image= works on image with /usr/ but without / (#36727)
Lennart Poettering [Thu, 13 Mar 2025 13:14:56 +0000 (14:14 +0100)] 
bootctl: make sure bootctl --image= works on image with /usr/ but without / (#36727)

```
Let's make sure we can use the tool on ParticleOS images. They have no
root fs by default (until they are instantiated), but always have /usr/.
Hence add DISSECT_IMAGE_USR_NO_ROOT which has the desired effect.
```

7 months agobootctl: tweak status output when operating on --image= files 36727/head
Lennart Poettering [Wed, 12 Mar 2025 20:59:49 +0000 (21:59 +0100)] 
bootctl: tweak status output when operating on --image= files

Let's not claim the system was not booted with UEFI if we use --image=.
The system wasn't booted at all, after all. Hence supress the whole
section altogether in this case.

7 months agobootctl: make sure bootctl --image= works on image with /usr/ but without /
Lennart Poettering [Wed, 12 Mar 2025 20:56:36 +0000 (21:56 +0100)] 
bootctl: make sure bootctl --image= works on image with /usr/ but without /

Let's make sure we can use the tool on ParticleOS images. They have no
root fs by default (until they are instantiated), but always have /usr/.
Hence add DISSECT_IMAGE_USR_NO_ROOT which has the desired effect.

7 months agoupdate TODO
Lennart Poettering [Thu, 13 Mar 2025 09:35:17 +0000 (10:35 +0100)] 
update TODO

7 months agoupdate TODO
Lennart Poettering [Thu, 13 Mar 2025 08:55:59 +0000 (09:55 +0100)] 
update TODO

7 months agotest-localed-util: use ASSERT_OK() and friends
Yu Watanabe [Thu, 13 Mar 2025 03:49:02 +0000 (12:49 +0900)] 
test-localed-util: use ASSERT_OK() and friends

7 months agoTEST-73-LOCALE: do not unnecessarily restart systemd-localed
Yu Watanabe [Thu, 13 Mar 2025 03:11:40 +0000 (12:11 +0900)] 
TEST-73-LOCALE: do not unnecessarily restart systemd-localed

It is not necessary to clear previous keymap assignment, as
`localectl set-keymap` will anyway overwrite the previous assignment.

This drops the unnecessary restart of systemd-localed in the loop.
The mkosi test image contains about 500~700 keymaps. The test
performance is greatly improved by reducing the number of restarts,
especially when the test is running with sanitizers.

On Fedora 41 with sanitizers,
Before:
1/1 systemd:integration-tests / TEST-73-LOCALE OK             1157.50s
After:
1/1 systemd:integration-tests / TEST-73-LOCALE OK              104.43s

7 months agoFix several issues found by Coverity (#36726)
Yu Watanabe [Wed, 12 Mar 2025 22:54:06 +0000 (07:54 +0900)] 
Fix several issues found by Coverity (#36726)

7 months agocopy: Bubble up ENOSPC immediately in fd_copy_directory()
Daan De Meyer [Wed, 12 Mar 2025 16:07:55 +0000 (17:07 +0100)] 
copy: Bubble up ENOSPC immediately in fd_copy_directory()

It doesn't really make sense to continue once we start getting ENOSPC.

7 months agoman: document how Restart= reacts to oom kill
Lennart Poettering [Wed, 12 Mar 2025 21:08:46 +0000 (22:08 +0100)] 
man: document how Restart= reacts to oom kill

Fixes: #36529
7 months agonsresource: fix GID check in io.systemd.UserDatabase.GetGroupRecord method
Yu Watanabe [Wed, 12 Mar 2025 18:27:31 +0000 (03:27 +0900)] 
nsresource: fix GID check in io.systemd.UserDatabase.GetGroupRecord method

Fixes a bug in 8aee931e7ae1adb01eeac0e1e4c0aef6ed3969ec (v256).

7 months agogetty-generator: don't use "3270!tty1" when instantiating serial-getty@.service on...
Franck Bui [Wed, 12 Mar 2025 16:51:39 +0000 (17:51 +0100)] 
getty-generator: don't use "3270!tty1" when instantiating serial-getty@.service on s390x

Path of the 3270 console in /sys is "/sys/class/tty/3270!tty1" but its device
node is "/dev/3270/tty1".

7 months agonsresource: fix error handling
Yu Watanabe [Wed, 12 Mar 2025 18:21:01 +0000 (03:21 +0900)] 
nsresource: fix error handling

7 months agoboot: several follow-ups for reboot-on-error feature (#36721)
Yu Watanabe [Wed, 12 Mar 2025 20:26:47 +0000 (05:26 +0900)] 
boot: several follow-ups for reboot-on-error feature (#36721)

7 months agoudev/net: enable new [EnergyEfficientEthernet] section
Yu Watanabe [Wed, 12 Mar 2025 15:56:28 +0000 (00:56 +0900)] 
udev/net: enable new [EnergyEfficientEthernet] section

Also fixes a typo in setting name.

Follow-up for cdc9be29b1f4eefd5d384b0a9fed25675c66def5.
Addresses post-merge comments for #36302.

7 months agounits: order oomd after swap.target
Lennart Poettering [Wed, 12 Mar 2025 16:13:24 +0000 (17:13 +0100)] 
units: order oomd after swap.target

oomd only works well if we have swap, hence we should not start it
before swaps are up, in particular as we will print an annoying message
otherwise.

Fixes: #36704
7 months agotest: wrap assignments in ASSERT_OK() and friends with parentheses 36726/head
Yu Watanabe [Wed, 12 Mar 2025 20:07:54 +0000 (05:07 +0900)] 
test: wrap assignments in ASSERT_OK() and friends with parentheses

Hopefully fixes many CID reports.

7 months agotest-netlink: fix use of ASSERT_OK()
Yu Watanabe [Wed, 12 Mar 2025 20:11:11 +0000 (05:11 +0900)] 
test-netlink: fix use of ASSERT_OK()

Follow-up for 3841288e5f8583208550f8215443bf8da6080fd1.

7 months agohomed: fix OOM check
Yu Watanabe [Wed, 12 Mar 2025 19:55:34 +0000 (04:55 +0900)] 
homed: fix OOM check

Follow-up for f1b6417fea8ea1fb9a57f45b845ab1db944eca23.
Fixes CID#1593167.

7 months agohomectl: insert missing 'else'
Yu Watanabe [Wed, 12 Mar 2025 19:52:48 +0000 (04:52 +0900)] 
homectl: insert missing 'else'

Follow-up for cc14c14782d542b35fa12bfdadfd64ffa700cedf.
Fixes CID#1593168 and CID#1593166.

7 months agoboot: fallback to unrestricted allocation if initrd allocation doesn't fit below...
Lennart Poettering [Wed, 12 Mar 2025 19:14:40 +0000 (20:14 +0100)] 
boot: fallback to unrestricted allocation if initrd allocation doesn't fit below 4g (#36715)

Fixes: #36706
7 months agoudev: use INTERFACE property rather than sysname when processing network interface...
Yu Watanabe [Wed, 12 Mar 2025 19:12:57 +0000 (04:12 +0900)] 
udev: use INTERFACE property rather than sysname when processing network interface (#36627)

sd-device replaces '!' in sysname with '/', hence sysname may be
different from ifname.
Let's use INTERFACE property when we need network interface name.

This fixes the following unexpected renaming of network interfaces
created with '!' in their name, e.g. 'hoge!foo' -> 'hoge_foo':
```
$ run0 ip link add 'hoge!foo' type dummy
$ ip link show 'hoge!foo'
Device "hoge!foo" does not exist.
$ ip link show 'hoge_foo'
410: hoge_foo: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether ee:54:4a:dd:c4:c7 brd ff:ff:ff:ff:ff:ff
```

Closes #26156.

7 months agoresolve: add warning comment to config file
Michael Catanzaro [Mon, 10 Mar 2025 18:11:54 +0000 (13:11 -0500)] 
resolve: add warning comment to config file

There are way too many users configuring the DNS= setting by mistake,
because what it seems to do is different from what it actually does. We
do not have consensus to change its behavior, so let's at least add a
warning comment.

Fixes #33973

7 months agoboot: introduce string tables for RebootOnError and sucure_boot_enroll 36721/head
Yu Watanabe [Wed, 12 Mar 2025 17:37:03 +0000 (02:37 +0900)] 
boot: introduce string tables for RebootOnError and sucure_boot_enroll

7 months agoboot: fix use of uninitialized value on error
Yu Watanabe [Wed, 12 Mar 2025 17:00:25 +0000 (02:00 +0900)] 
boot: fix use of uninitialized value on error

Follow-up for 0bdf94e588c8d781a91e5738525d673c0966a510.

7 months agonetlink-util: move several function prototypes 36627/head
Yu Watanabe [Wed, 5 Mar 2025 21:35:45 +0000 (06:35 +0900)] 
netlink-util: move several function prototypes

7 months agonetlink-util: allow to call rtnl_set_link_name() and friends with NULL rtnl
Yu Watanabe [Sun, 9 Mar 2025 00:24:52 +0000 (09:24 +0900)] 
netlink-util: allow to call rtnl_set_link_name() and friends with NULL rtnl

7 months agonetlink-util: merge rtnl_get_link_info() and rtnl_get_ifname_full() into rtnl_get_lin...
Yu Watanabe [Wed, 5 Mar 2025 21:30:15 +0000 (06:30 +0900)] 
netlink-util: merge rtnl_get_link_info() and rtnl_get_ifname_full() into rtnl_get_link_info_full()

Then, this makes rtnl_get_ifname_full() and friends as inline wrappers of
rtnl_get_link_info_full().

7 months agotest-netlink: use ASSERT_OK() and friends
Yu Watanabe [Thu, 6 Mar 2025 02:48:54 +0000 (11:48 +0900)] 
test-netlink: use ASSERT_OK() and friends

7 months agotests: introduce ASSERT_PTR_EQ()
Yu Watanabe [Thu, 6 Mar 2025 03:11:43 +0000 (12:11 +0900)] 
tests: introduce ASSERT_PTR_EQ()

7 months agoudev/net: replace device_unsigned_attribute() with device_get_sysattr_unsigned()
Yu Watanabe [Wed, 5 Mar 2025 21:53:37 +0000 (06:53 +0900)] 
udev/net: replace device_unsigned_attribute() with device_get_sysattr_unsigned()

They are completely equivalent, except for logging.
This also drops duplicated log messages on failure paths.

7 months agoudev/net: fix assignment of ID_NET_NAME=
Yu Watanabe [Wed, 5 Mar 2025 22:25:28 +0000 (07:25 +0900)] 
udev/net: fix assignment of ID_NET_NAME=

E.g. sd_device object of network interface 'hoge!foo' has sysname 'hoge/foo'.
So, previously udevd assigned 'hoge/foo' rather than 'hoge!foo' to ID_NET_NAME,
hence even when renaming is not requested, such interface was renamed to 'hoge_foo'
(note '/' cannot be used in network interface name, hence escaped to underbar).

7 months agoudev-event: fix filtering logic of renaming network interface
Yu Watanabe [Wed, 5 Mar 2025 23:22:54 +0000 (08:22 +0900)] 
udev-event: fix filtering logic of renaming network interface

The device sysname may be different from the network interface name.

7 months agoudev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is...
Yu Watanabe [Wed, 5 Mar 2025 23:19:45 +0000 (08:19 +0900)] 
udev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is a network interface

This does not change any behavior, as currently udevd only supports
renaming for network interfaces.

Closes #26156.

7 months agoudev-builtin-net_driver: use correct interface name
Yu Watanabe [Wed, 5 Mar 2025 23:16:10 +0000 (08:16 +0900)] 
udev-builtin-net_driver: use correct interface name

Previously, when the interface name contains '!', the builtin command
failed to get the driver of the interface.

7 months agosd_device: introduce device_get_ifname()
Yu Watanabe [Wed, 5 Mar 2025 22:03:45 +0000 (07:03 +0900)] 
sd_device: introduce device_get_ifname()

sd-device replaces '!' in sysname with '/'. Hence, sysname and ifname
may be different. Let's get network interface name through INTERFACE
property.

7 months agotest: do not pass return value to log_error_errno() on success
Yu Watanabe [Sun, 9 Mar 2025 02:00:37 +0000 (11:00 +0900)] 
test: do not pass return value to log_error_errno() on success

7 months agotest-sd-device: use ASSERT_OK() and friends
Yu Watanabe [Sun, 9 Mar 2025 01:15:29 +0000 (10:15 +0900)] 
test-sd-device: use ASSERT_OK() and friends

7 months agosd-device: reorder elements in sd_device object
Yu Watanabe [Wed, 5 Mar 2025 18:47:56 +0000 (03:47 +0900)] 
sd-device: reorder elements in sd_device object

No functional change, just refactoring.

7 months agosd-device: protect more properties often set by kernel and internally used by udevd
Yu Watanabe [Wed, 5 Mar 2025 18:26:04 +0000 (03:26 +0900)] 
sd-device: protect more properties often set by kernel and internally used by udevd

7 months agohostname: several follow-ups for wildcard hostname support (#36707)
Yu Watanabe [Wed, 12 Mar 2025 15:46:00 +0000 (00:46 +0900)] 
hostname: several follow-ups for wildcard hostname support (#36707)

7 months agotest-cgroup-util: Check return values (#36024)
Lennart Poettering [Wed, 12 Mar 2025 14:50:33 +0000 (15:50 +0100)] 
test-cgroup-util: Check return values (#36024)

Reported by Coverity and
Fixes CID#1587767

7 months agoboot: add reboot-on-error config option
nkraetzschmar [Tue, 11 Mar 2025 12:23:14 +0000 (13:23 +0100)] 
boot: add reboot-on-error config option

Enabling this option will cause the system to reboot in case the selected
entry fails to load.

7 months agoFixes several recent CI issues (#36691)
Lennart Poettering [Wed, 12 Mar 2025 14:32:58 +0000 (15:32 +0100)] 
Fixes several recent CI issues (#36691)

- Fixes a race in systemd-run caused by
b7ba8d55b8e413ff326abc4814b92d42b8d3c3c3, which causes issue #36679.
- Skip verifying masked units in TEST-23.
- Avoid false-positive ASan warning by switching sanitizer run from
Fedora rawhide to Fedora 41, caused by recent update from
llvm-19.1.7-11.fc43 to llvm-20.1.0-1.fc43. Hopefully issue #36678 should
be fixed.

Closes #36678.
Closes #36679.

7 months agomeson: drop split-usr, rootlibdir, and rootprefix from meson_options.txt
Yu Watanabe [Sun, 9 Mar 2025 02:45:00 +0000 (11:45 +0900)] 
meson: drop split-usr, rootlibdir, and rootprefix from meson_options.txt

These options were deprecated by b0d3095fd6cc1791a38f57a1982116b4475244ba (v255).
Let's remove them completely.

7 months agoupdate TODO
Lennart Poettering [Wed, 12 Mar 2025 12:34:47 +0000 (13:34 +0100)] 
update TODO

7 months agoupdate TODO
Lennart Poettering [Wed, 12 Mar 2025 10:11:33 +0000 (11:11 +0100)] 
update TODO

7 months agotest-cgroup-util: Ignore LXC group 36024/head
Michal Koutný [Mon, 3 Feb 2025 16:02:09 +0000 (17:02 +0100)] 
test-cgroup-util: Ignore LXC group

LXC helper processes hide themselve in .lxc cgroup, we don't have to
deal with the inside tests (and the error in conversion to unit is handled).
Skip those but keep iterating over remaining processes to detect what
can be created around us.

7 months agotest-cgroup-util: Skip procs analysis without cgroupfs
Michal Koutný [Fri, 17 Jan 2025 17:00:25 +0000 (18:00 +0100)] 
test-cgroup-util: Skip procs analysis without cgroupfs

cg_pidref_get_path() cannot work (current implementaion) without
cgroupfs (when it checks unified or not setup). Similarly,
cg_pidref_get_unit() assumes all processes are part of a unit. So carry
out the test only when running on a systemd setup.

7 months agotest-cgroup-util: Check return values
Michal Koutný [Wed, 15 Jan 2025 15:36:28 +0000 (16:36 +0100)] 
test-cgroup-util: Check return values

The test is supposed to check a battery of cgroup helpers on each
process found but it doesn't literally check anything besides presence
of procfs. (One can visually check printed output only. Introduction in
aff38e74bd ("nspawn: suffix the nspawn cgroups with ".nspawn"").)

Make some assumptions about visible processes and turn the test into
testing that systemd helpers can deal with whatever process they find on
the SUT.

Reported by Coverity and
Fixes CID#1587767

7 months agohostname-setup: use strchr() to find wildcard character 36707/head
Yu Watanabe [Tue, 11 Mar 2025 21:46:36 +0000 (06:46 +0900)] 
hostname-setup: use strchr() to find wildcard character

Addresses https://github.com/systemd/systemd/pull/36647#discussion_r1990048751.

7 months agotest: add test cases for hostname_substitute_wildcards()
Yu Watanabe [Tue, 11 Mar 2025 21:44:21 +0000 (06:44 +0900)] 
test: add test cases for hostname_substitute_wildcards()

The function is indirectly tested through read_etc_hostname(), but let's
also test it directly.

7 months agohostname: fix typo
Yu Watanabe [Tue, 11 Mar 2025 21:26:45 +0000 (06:26 +0900)] 
hostname: fix typo

Follow-up for af9c45d5b6c1b1962731dffc638a2320e5eef095.

7 months agoresolve question marks in /etc/hostname to characters hashed from machine ID (#36647)
Yu Watanabe [Tue, 11 Mar 2025 19:50:33 +0000 (04:50 +0900)] 
resolve question marks in /etc/hostname to characters hashed from machine ID (#36647)

So I have a bunch of particle os instances around, that I frequently
factory reset. and it's confusing, since they all have the same name.
Let's do something about this, and extend the hostname setup logic a bit
to deal better with "cattle" rather than "pet" deployments.
Specifically: if a hostname in /etc/hostname contains a bunch of
question marks we'll replace it with hex chars hashed from the machine
id.

This allows us to do something like this:

hostnamectl set-hostname --static 'funky-????-????-???'

and we'll end up with a hostname like `funky-baf4-b653-e230`

7 months agomountfsd: add complete varlink introspection comments (#36703)
Yu Watanabe [Tue, 11 Mar 2025 19:48:12 +0000 (04:48 +0900)] 
mountfsd: add complete varlink introspection comments (#36703)

7 months agorun: check if the start job is finished on PropertiesChanged signal and so on 36691/head
Yu Watanabe [Mon, 10 Mar 2025 20:15:11 +0000 (05:15 +0900)] 
run: check if the start job is finished on PropertiesChanged signal and so on

Otherwise, if systemd-run is disconnected from bus before JobRemoved
signal, then c->start_job will never freed, thus run_context_check_done()
will never call sd_event_exit() even after the service is finished.

This drops monitoring JobRemoved signal, and make systemd-run check if
the start job is started when PropertiesChanged signal is received.

Follow-up for b7ba8d55b8e413ff326abc4814b92d42b8d3c3c3.

Fixes #36679.

7 months agoTEST-74-AUX-UTILS: fail earlier when systemd-run fail to reconnect to bus
Yu Watanabe [Mon, 10 Mar 2025 19:27:18 +0000 (04:27 +0900)] 
TEST-74-AUX-UTILS: fail earlier when systemd-run fail to reconnect to bus

Note, the default timeout for systemctl daemon-reload is 270 seconds.
Hence, 300 seconds should be enough.

7 months agoci/mkosi: enable sanitizers on Fedora 41
Yu Watanabe [Mon, 10 Mar 2025 16:54:28 +0000 (01:54 +0900)] 
ci/mkosi: enable sanitizers on Fedora 41

It seems the recent update of LLVM package in Fedora rawhide breaks
sanitizers, and udevd freezes after false-positive (I guess) issue is
detected:

systemd-udevd[2646]: =================================================================
systemd-udevd[2646]: ==2646==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7ffc3a642660 at pc 0x555627ac022b bp 0x7ffc3a6422b0 sp 0x7ffc3a6422a8
systemd-udevd[2646]: READ of size 8 at 0x7ffc3a642660 thread T0 ((udev-worker))

llvm-19.1.7-11.fc43 worked fine, but llvm-20.1.0-1.fc43 does not.
To avoid the issue, let's enable sanitizer on Fedora 41, and disable it
on Fedora rawhide.

Closes #36678.

7 months agoTEST-23-UNIT-FILE: skip verifying masked unit
Yu Watanabe [Mon, 10 Mar 2025 19:21:11 +0000 (04:21 +0900)] 
TEST-23-UNIT-FILE: skip verifying masked unit

This fixes the following failure:
TEST-23-UNIT-FILE.sh[2408]: + systemd-analyze --recursive-errors=no --man=no verify /usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
systemd-analyze[2737]: sys-kernel-config.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: proc-sys-fs-binfmt_misc.automount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-hugepages.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-tracing.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-debug.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-fs-fuse-connections.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-mqueue.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: Unit systemd-hwdb-update.service is masked.
TEST-23-UNIT-FILE.sh[166]: + :
TEST-23-UNIT-FILE.sh[166]: + kill -0 2408
TEST-23-UNIT-FILE.sh[166]: + wait 2408
TEST-23-UNIT-FILE.sh[166]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed'
TEST-23-UNIT-FILE.sh[166]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed

7 months agoupdate TODO 36703/head
Lennart Poettering [Tue, 11 Mar 2025 10:58:49 +0000 (11:58 +0100)] 
update TODO

7 months agomountfsd: also return suggested mount point paths for the returned partitions
Lennart Poettering [Tue, 11 Mar 2025 10:43:17 +0000 (11:43 +0100)] 
mountfsd: also return suggested mount point paths for the returned partitions

When mounting a disk image we return a bunch of mount fds referencing
the various partitions in the disk, along with some metadata about them.
One key metadata field is the "designator" which is supposed to tell
clients what is what, and where to mount it.

Let's make this more explicit: let's also include the literal relative
path where each mount shall be placed, to simplify implementations of
clients that do not care about the concept of designators.

7 months agomountfsd: complete varlink introspection comments
Lennart Poettering [Tue, 11 Mar 2025 10:14:15 +0000 (11:14 +0100)] 
mountfsd: complete varlink introspection comments

7 months agoupdate TODO
Lennart Poettering [Tue, 11 Mar 2025 17:19:24 +0000 (18:19 +0100)] 
update TODO

7 months agoupdate TODO 36647/head
Lennart Poettering [Thu, 6 Mar 2025 22:11:08 +0000 (23:11 +0100)] 
update TODO

7 months agotest: add test checking if pattern based hostnames work
Lennart Poettering [Fri, 7 Mar 2025 08:32:58 +0000 (09:32 +0100)] 
test: add test checking if pattern based hostnames work

7 months agohostname: support that /etc/hostname contains ??? as wildcards to be replaced by...
Lennart Poettering [Thu, 6 Mar 2025 17:31:12 +0000 (18:31 +0100)] 
hostname: support that /etc/hostname contains ??? as wildcards to be replaced by hash value from /etc/machine-id

7 months agobasic: move gethostname_full() from basic/hostname-util.c → shared/hostname-setup.c
Lennart Poettering [Thu, 6 Mar 2025 17:28:44 +0000 (18:28 +0100)] 
basic: move gethostname_full() from basic/hostname-util.c → shared/hostname-setup.c

In one of the next commits we'd like to introduce a concept of
optionally hashing the hostname from the machine ID. For that we we need
to optionally back gethostname_full() by code involving sd-id128, hence
let's move it from src/basic/ to src/shared/, since only there we are
allowed to use our public APIs.

7 months agoupdate TODO
Lennart Poettering [Tue, 11 Mar 2025 16:19:25 +0000 (17:19 +0100)] 
update TODO

7 months agobus-polkit: shortcut auth. after first denial
David Tardon [Fri, 7 Mar 2025 15:22:00 +0000 (16:22 +0100)] 
bus-polkit: shortcut auth. after first denial

A D-Bus/Varlink method can issue PolicyKit auth. requests for multiple
actions; in this case the method is expected to fail on the first one
that is not allowed. This is enforced by asserts in
async_polkit_read_reply(), but that's a wrong place for the check for
two reasons:

1. it doesn't allow to get a meaningful stack trace;
2. sending the query to polkit is already a pointless exercise.

Let's do the check in *_verify_polkit_async_full() and don't send
anything to PolicyKit in that case.

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2349594 .

7 months agodocs: clarify userns mapping when /proc/sys is rw
Ivan Kruglov [Wed, 19 Feb 2025 11:14:20 +0000 (03:14 -0800)] 
docs: clarify userns mapping when /proc/sys is rw

7 months agocgroup-util: Handle capsule@ paths like user@ paths (#36664)
Lennart Poettering [Tue, 11 Mar 2025 11:03:57 +0000 (12:03 +0100)] 
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

7 months agocore/service: introduce sd_notify() RESTART_RESET=1 for resetting restart counter...
Lennart Poettering [Tue, 11 Mar 2025 11:03:12 +0000 (12:03 +0100)] 
core/service: introduce sd_notify() RESTART_RESET=1 for resetting restart counter (#36698)

7 months agocore/main: fix logging of /sbin/init exec failure
Mike Yuan [Sun, 9 Mar 2025 13:14:45 +0000 (14:14 +0100)] 
core/main: fix logging of /sbin/init exec failure

Follow-up for 93e19483dc9fae94d713d036ecee669450bd002d

While at it, avoid duplicate manager_status_printf()
(error_message will be shown in main()).

7 months agotmpfiles: ignore ENOENT when file is removed during setting parmission and friends
Yu Watanabe [Mon, 10 Mar 2025 22:01:16 +0000 (07:01 +0900)] 
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.

7 months agoupdate TODO
Lennart Poettering [Tue, 11 Mar 2025 09:46:13 +0000 (10:46 +0100)] 
update TODO

7 months agoudev: reread partition table and trigger synthetic change events in child process...
Yu Watanabe [Tue, 11 Mar 2025 09:43:43 +0000 (18:43 +0900)] 
udev: reread partition table and trigger synthetic change events in child process (#36685)

7 months agocgroup-util: Handle capsule@ paths like user@ paths 36664/head
Michal Koutný [Mon, 3 Feb 2025 13:44:20 +0000 (14:44 +0100)] 
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

7 months agoTODO: support RESTART_RESET=1 in journal-upload 36698/head
Mike Yuan [Sun, 27 Oct 2024 12:05:01 +0000 (13:05 +0100)] 
TODO: support RESTART_RESET=1 in journal-upload

7 months agocore/service: introduce sd_notify() RESTART_RESET=1 for resetting restart counter
Mike Yuan [Fri, 25 Oct 2024 23:51:04 +0000 (01:51 +0200)] 
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.

7 months agocore/unit: disable unit debug invocation in generic unit_reset_failed()
Mike Yuan [Fri, 8 Nov 2024 15:57:40 +0000 (16:57 +0100)] 
core/unit: disable unit debug invocation in generic unit_reset_failed()

7 months agoudev: use ERRNO_IS_NEG_* where appropriate (#36690)
Yu Watanabe [Mon, 10 Mar 2025 22:51:41 +0000 (07:51 +0900)] 
udev: use ERRNO_IS_NEG_* where appropriate (#36690)

Follow-up for f8825c1364fb1c3f3f5d96654e779fd51500f476.

7 months agoudev: scan partitions and trigger synthetic change events in child process 36685/head
Yu Watanabe [Mon, 10 Mar 2025 13:44:02 +0000 (22:44 +0900)] 
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.

7 months agoudev: split out synthesize_change_all() from synthesize_change()
Yu Watanabe [Mon, 10 Mar 2025 13:39:50 +0000 (22:39 +0900)] 
udev: split out synthesize_change_all() from synthesize_change()

No functional change. Preparation for later change.

7 months agoumount: do not move busy network mounts
Antonio Alvarez Feijoo [Mon, 10 Mar 2025 11:21:26 +0000 (12:21 +0100)] 
umount: do not move busy network mounts

If a network mount returns EBUSY on umount, the logic introduced in
6dc68a00cfc816678fd713b12ae2a4cf2ae6da85 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 6dc68a00cfc816678fd713b12ae2a4cf2ae6da85

7 months agonsresourced,vmspawn,mountfsd: various smaller fixes (#36689)
Yu Watanabe [Mon, 10 Mar 2025 20:50:04 +0000 (05:50 +0900)] 
nsresourced,vmspawn,mountfsd: various smaller fixes (#36689)

7 months agoevent-util: move event_source_hash_ops to event-util
Yu Watanabe [Mon, 10 Mar 2025 10:29:51 +0000 (19:29 +0900)] 
event-util: move event_source_hash_ops to event-util

7 months agonsresourced,mountfsd: set userdata pointer via varlink_server_new() 36689/head
Lennart Poettering [Mon, 10 Mar 2025 12:35:45 +0000 (13:35 +0100)] 
nsresourced,mountfsd: set userdata pointer via varlink_server_new()

7 months agovmspawn: properly exit in vmspawn child on failure
Lennart Poettering [Mon, 10 Mar 2025 10:37:03 +0000 (11:37 +0100)] 
vmspawn: properly exit in vmspawn child on failure

7 months agonsresourced: fix initialization of netns_fd_idx
Lennart Poettering [Sun, 9 Mar 2025 07:13:47 +0000 (08:13 +0100)] 
nsresourced: fix initialization of netns_fd_idx

7 months agonsresourced: clear up some type confusion
Lennart Poettering [Sun, 9 Mar 2025 07:09:40 +0000 (08:09 +0100)] 
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.

7 months agonsresourced: permit numeric uid/gid also be specified as strings
Lennart Poettering [Sun, 9 Mar 2025 07:03:24 +0000 (08:03 +0100)] 
nsresourced: permit numeric uid/gid also be specified as strings

7 months agonsresourced: fix offset
Lennart Poettering [Mon, 10 Mar 2025 15:35:09 +0000 (16:35 +0100)] 
nsresourced: fix offset

Follow-up for: ee6fd7ef82522d538dd513e8aabf6d29ece4dc92

7 months agosystemd.exec(5): RestrictAddressFamilies: mention address_families(7)
NetSysFire [Mon, 10 Mar 2025 14:24:26 +0000 (15:24 +0100)] 
systemd.exec(5): RestrictAddressFamilies: mention address_families(7)

7 months agorun: declare ARG_STDIO_XYZ like a flag
Yu Watanabe [Mon, 10 Mar 2025 09:22:28 +0000 (18:22 +0900)] 
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.