1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-13 00:58:27 +03:00

80065 Commits

Author SHA1 Message Date
Yu Watanabe
e0111277e4 nsresource: fix GID check in io.systemd.UserDatabase.GetGroupRecord method
Fixes a bug in 8aee931e7ae1adb01eeac0e1e4c0aef6ed3969ec (v256).
2025-03-13 05:35:54 +09:00
Franck Bui
dbe61d9ec7 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".
2025-03-13 05:34:37 +09:00
Yu Watanabe
36a9e47a0d nsresource: fix error handling 2025-03-13 05:27:50 +09:00
Yu Watanabe
e66c71a786
boot: several follow-ups for reboot-on-error feature (#36721) 2025-03-13 05:26:47 +09:00
Yu Watanabe
86cbb13a4e udev/net: enable new [EnergyEfficientEthernet] section
Also fixes a typo in setting name.

Follow-up for cdc9be29b1f4eefd5d384b0a9fed25675c66def5.
Addresses post-merge comments for #36302.
2025-03-13 05:26:14 +09:00
Lennart Poettering
5dbf476b11 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
2025-03-13 05:24:11 +09:00
Lennart Poettering
c5a5046792
boot: fallback to unrestricted allocation if initrd allocation doesn't fit below 4g (#36715)
Fixes: #36706
2025-03-13 04:14:40 +09:00
Yu Watanabe
f9ddbc5b35
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.
2025-03-13 04:12:57 +09:00
Michael Catanzaro
780f320229 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
2025-03-13 04:12:18 +09:00
Yu Watanabe
1ae60b69fa boot: introduce string tables for RebootOnError and sucure_boot_enroll 2025-03-13 02:40:12 +09:00
Yu Watanabe
c5710c00ff boot: fix use of uninitialized value on error
Follow-up for 0bdf94e588c8d781a91e5738525d673c0966a510.
2025-03-13 02:40:12 +09:00
Yu Watanabe
2ee01dbc05 netlink-util: move several function prototypes 2025-03-13 01:48:50 +09:00
Yu Watanabe
472ad6af94 netlink-util: allow to call rtnl_set_link_name() and friends with NULL rtnl 2025-03-13 01:48:50 +09:00
Yu Watanabe
0e44a7c085 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().
2025-03-13 01:48:50 +09:00
Yu Watanabe
3841288e5f test-netlink: use ASSERT_OK() and friends 2025-03-13 01:48:50 +09:00
Yu Watanabe
f0ebc0c5bf tests: introduce ASSERT_PTR_EQ() 2025-03-13 01:48:50 +09:00
Yu Watanabe
6e316e8104 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.
2025-03-13 01:48:50 +09:00
Yu Watanabe
b15053de89 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).
2025-03-13 01:48:33 +09:00
Yu Watanabe
b3157fc912 udev-event: fix filtering logic of renaming network interface
The device sysname may be different from the network interface name.
2025-03-13 01:08:57 +09:00
Yu Watanabe
4352457a96 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.
2025-03-13 01:08:57 +09:00
Yu Watanabe
e3bc8d3449 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.
2025-03-13 01:08:57 +09:00
Yu Watanabe
bec2f4dc3e 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.
2025-03-13 01:08:57 +09:00
Yu Watanabe
32b0e689d6 test: do not pass return value to log_error_errno() on success 2025-03-13 01:08:57 +09:00
Yu Watanabe
0f52a1107e test-sd-device: use ASSERT_OK() and friends 2025-03-13 01:08:57 +09:00
Yu Watanabe
c7523292da sd-device: reorder elements in sd_device object
No functional change, just refactoring.
2025-03-13 01:08:57 +09:00
Yu Watanabe
1707b41e76 sd-device: protect more properties often set by kernel and internally used by udevd 2025-03-13 01:08:53 +09:00
Yu Watanabe
a4cb6c41a1
hostname: several follow-ups for wildcard hostname support (#36707) 2025-03-13 00:46:00 +09:00
Lennart Poettering
b330824e59
test-cgroup-util: Check return values (#36024)
Reported by Coverity and
Fixes CID#1587767
2025-03-12 15:50:33 +01:00
nkraetzschmar
0bdf94e588 boot: add reboot-on-error config option
Enabling this option will cause the system to reboot in case the selected
entry fails to load.
2025-03-12 15:47:38 +01:00
Lennart Poettering
d54196a4cd
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.
2025-03-12 15:32:58 +01:00
Yu Watanabe
11361e3293 meson: drop split-usr, rootlibdir, and rootprefix from meson_options.txt
These options were deprecated by b0d3095fd6cc1791a38f57a1982116b4475244ba (v255).
Let's remove them completely.
2025-03-12 15:21:57 +01:00
Lennart Poettering
d77bf27c80 update TODO 2025-03-12 13:35:20 +01:00
Lennart Poettering
36f529fd2d update TODO 2025-03-12 13:30:30 +01:00
Michal Koutný
b67a45841f 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.
2025-03-12 11:46:19 +01:00
Michal Koutný
b78003c793 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.
2025-03-12 10:31:23 +01:00
Michal Koutný
ca82f0cbe2 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
2025-03-12 10:31:23 +01:00
Yu Watanabe
35d5defc4e hostname-setup: use strchr() to find wildcard character
Addresses https://github.com/systemd/systemd/pull/36647#discussion_r1990048751.
2025-03-12 06:48:57 +09:00
Yu Watanabe
851c706e74 test: add test cases for hostname_substitute_wildcards()
The function is indirectly tested through read_etc_hostname(), but let's
also test it directly.
2025-03-12 06:44:42 +09:00
Yu Watanabe
1f5d8a6132 hostname: fix typo
Follow-up for af9c45d5b6c1b1962731dffc638a2320e5eef095.
2025-03-12 06:26:56 +09:00
Yu Watanabe
ced634a62d
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`
2025-03-12 04:50:33 +09:00
Yu Watanabe
f3580b6807
mountfsd: add complete varlink introspection comments (#36703) 2025-03-12 04:48:12 +09:00
Yu Watanabe
1ac2fc4984 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.
2025-03-12 04:33:46 +09:00
Yu Watanabe
07355061db 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.
2025-03-12 04:33:46 +09:00
Yu Watanabe
9670922d44 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.
2025-03-12 04:33:46 +09:00
Yu Watanabe
e5e7cc9a98 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
2025-03-12 04:33:46 +09:00
Lennart Poettering
5721b9bc46 update TODO 2025-03-11 18:20:31 +01:00
Lennart Poettering
0ecfcc9790 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.
2025-03-11 18:20:31 +01:00
Lennart Poettering
00c17ad5cf mountfsd: complete varlink introspection comments 2025-03-11 18:20:31 +01:00
Lennart Poettering
16771b505e update TODO 2025-03-11 18:19:24 +01:00
Lennart Poettering
06967d4049 update TODO 2025-03-11 18:01:42 +01:00