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

78287 Commits

Author SHA1 Message Date
Yu Watanabe
26f65dc0c7 TEST-35-LOGIN: check only tty session
For some reasons, another session logind-test-user may be started.
===
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 15 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: VT changed to 2
Dec 13 07:04:16 systemd-logind[2140]: rfkill: Found udev node /dev/rfkill for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: udmabuf: Found udev node /dev/udmabuf for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/timer for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/seq for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/timer for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/rfkill for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/udmabuf for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/seq for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd[1]: user-4712.slice: Changed dead -> active
Dec 13 07:04:16 systemd[1]: user-4712.slice: Job 5951 user-4712.slice/start finished, result=done
Dec 13 07:04:16 systemd[1]: Created slice user-4712.slice.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Choosing session 15 in preference to -
(snip)
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 16 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Ignoring session 16
===
Let's track only session for the user with tty, which we explicitly created.

Fixes #35597.
2024-12-15 21:10:03 +09:00
Yu Watanabe
ab70e42999 udev/net: make Link object take reference to UdevEvent
No functional change, just refactoring.
2024-12-15 09:21:46 +09:00
Yu Watanabe
4a90166488 udev: introduce reference counter for UdevEvent
No functional change, preparation for later commits.
2024-12-15 09:20:45 +09:00
Yu Watanabe
036c75ded3 udev-builtin: make udev_builtin_add_property() and friends take UdevEvent*
No functional change, just refactoring.
2024-12-15 09:20:43 +09:00
Ronan Pigott
e803e95760 network: don't warn with no NSID assigned
This is nothing interesting to warn about. Also use the symbolic
constant name when testing for this condition.
2024-12-15 09:09:26 +09:00
Luca Boccassi
498c20fad6 test: include MAINPID in notify message in TEST-50-DISSECT for notify socket
Copy what systemd-notify does by default by setting it to the PID of the shell,
so that main process tracking works as expected. Also use test -S instead of ls
to check socket.

[   33.980396] (sh)[1024]: run-p1022-i1322.service: Executing: sh -c "echo READY=1 | ncat --unixsock --udp \$NOTIFY_SOCKET --source /run/notify && env"
[   34.138778] systemd[1]: run-p1022-i1322.service: Child 1024 belongs to run-p1022-i1322.service.
[   34.138825] systemd[1]: run-p1022-i1322.service: Main process exited, code=exited, status=0/SUCCESS (success)
[   34.139451] systemd[1]: run-p1022-i1322.service: Failed with result 'protocol'.
[   34.139559] systemd[1]: run-p1022-i1322.service: Service will not restart (restart setting)
[   34.139573] systemd[1]: run-p1022-i1322.service: Changed start -> failed
[   34.139945] systemd[1]: run-p1022-i1322.service: Job 1364 run-p1022-i1322.service/start finished, result=failed

Fixes #35619

Follow-up for 18bb30c3b2
2024-12-15 09:07:57 +09:00
Luca Boccassi
c5f95bc19b
udev: move several definitions (#35613) 2024-12-14 16:32:02 +00:00
Yu Watanabe
3f1d499964 test-time-util: fix truncation of usec to sec
Also
- use ASSERT_XYZ() macros,
- log tzname[] on failure.
2024-12-14 15:23:52 +00:00
Luca Boccassi
301c159ce5 mkosi: fix section for WithNetwork=
/tmp/autopkgtest.L6NPL0/build.doZ/src/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/network.conf: Setting WithNetwork should be configured in [Build], not [Content]
2024-12-14 15:12:28 +00:00
Luca Boccassi
d68c8888c2
TEST-07-PID1: fixlets for running with sanitizers (#35616)
Hopefully fixes #35546.
2024-12-14 12:21:45 +00:00
Yu Watanabe
b8f49003d3 TEST-07-PID1: skip test cases that invokes unshare when running with sanitizers
Fixes #35546.
2024-12-14 19:47:47 +09:00
Yu Watanabe
7f14902cc2 mkosi: drop wrapper for unshare
This effectively reverts ef9a3241b3,
as it does not work.
2024-12-14 17:30:01 +09:00
Yu Watanabe
0bdcca5aee udev: move enums to udev-def.h
No functional change, just refactoring and preparation for later
commits.
2024-12-14 16:19:57 +09:00
Yu Watanabe
a2840b9599 udev: move listen_fds() to udev-manager.c
Also
- drop redundant error message when manager_init() failed,
- close unexpected fds.

No functional change, just refactoring.
2024-12-14 16:19:57 +09:00
Yu Watanabe
7ab25935f3 udev: several coding style fixes
- use 'type* func()' rather than 'type *func()',
- merge variable declarations,
- etc.
2024-12-14 06:50:59 +00:00
Daan De Meyer
61ecc410ea
udev: several trivial cleanups for builtins (#35612) 2024-12-14 06:48:50 +00:00
Yu Watanabe
7edb1b42fc test-udev-spawn: migrate to use ASSERT_XYZ() 2024-12-14 06:47:14 +00:00
Yu Watanabe
46d9f19465 udev-builtin-kmod: log about unloading only when already loaded 2024-12-14 11:29:05 +09:00
Yu Watanabe
9c6c4ad173 udev-builtin: drop unnecessary 'initialized' flag
All builtin _init() functions can be called multiple times gracefully,
and _exit() can be called without _init() called.
2024-12-14 11:29:05 +09:00
Yu Watanabe
975115321f udev-builtin: use FOREACH_ELEMENT() macro 2024-12-14 11:29:05 +09:00
David Härdeman
130698dc20 logind: allow wall messages to be controlled via config file
Right now, the sending of wall messages on reboot/shutdown/etc can be
controlled via DBus properties. This patch adds support for changing the
default via the logind.conf file as well.

Note that the DBus setting is lost if logind is restarted or reloaded,
but it was already the case before this patch that the setting is lost
upon restart.
2024-12-14 10:54:58 +09:00
Yu Watanabe
db09f8ad1b
Replace array with magic indices with normal variables in vconsole-setup (#35181) 2024-12-14 10:49:01 +09:00
Yu Watanabe
3fbc35bf9a
core: log disconnect on api and system busses, and dump list of subscribers (#35603)
Split out of #35406.
2024-12-14 10:20:35 +09:00
Yu Watanabe
beed1447b9
log: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set (#35606)
Let's implement our own protocols, and raise the log level to debug if
DEBUG_INVOCATION=1 is set.

Follow-up for: 7d8bbfbe08
2024-12-14 10:16:53 +09:00
Yu Watanabe
8746c17e15
network: add MPLSRouting= setting to enable MPLS routing (#35495)
Closing #35487.
2024-12-14 09:35:19 +09:00
Luca Boccassi
764c91ed12
semaphore: bump timeout (#35610)
When semaphore is overloaded tests can take more than 1hr, bump timeout
and reinstate some removed tests
2024-12-14 00:21:39 +00:00
Luca Boccassi
7406e0a3af Revert "semaphore: skip some tests"
This reverts commit e19cae12ff.
2024-12-13 23:43:28 +00:00
Luca Boccassi
1855064d4e semaphore: bump timeout
When semaphore is overloaded tests can take more than 1hr, bump
timeout
2024-12-13 22:08:27 +00:00
Lennart Poettering
b92be9b8e0 update TODO 2024-12-13 20:00:41 +01:00
Lennart Poettering
3e32e5a4d2 log: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set
Let's implement our own protocols, and raise the log level to debug if
DEBUG_INVOCATION=1 is set.

Follow-up for: 7d8bbfbe08
2024-12-13 19:53:55 +01:00
Zbigniew Jędrzejewski-Szmek
f393b2f99f vconsole-setup: drop impossible condition 2024-12-13 16:23:05 +00:00
Zbigniew Jędrzejewski-Szmek
a814fd7897 vconsole-setup: use normal variables instead of an array
We had this elaborate scheme with an array of strings instead of a bunch of a
normal string fields. If there were hundreds of those strings, this would make
sense. But we had just five and one was actually a bit different because it had
a fallback, so overall, the code is easier to read when normal fields are used.

The fallback was implemented in the accessor function, now it's actually
implemented in the place where it's used.

While at it, rename the variables so that they match the config keys for
legibility.
2024-12-13 16:23:05 +00:00
Zbigniew Jędrzejewski-Szmek
390bab5392 tmpfiles: reduce quoting in warning message
We printed:
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/20-systemd-shell-extra.conf:10: Unknown modifiers in command 'L$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:10: Unknown modifiers in command 'd$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:11: Unknown modifiers in command 'd$'.
...

There's a lot of additional characters here make the message harder to parse. We know
that the command is a word without any whitespace, so quoting isn't really necessary.

Change this to:
... unknown modifiers in command: L$
2024-12-13 16:23:05 +00:00
Yu Watanabe
af44a16ec7 test-network: add test case for MPLSRouting=yes 2024-12-13 15:36:45 +00:00
Yu Watanabe
10a768443a network: introduce MPLSRouting= to enable MPLS routing
Closing #35487.
2024-12-13 15:36:45 +00:00
Yu Watanabe
dcd333168e sysctl-util: support AF_MPLS
To support writing/reading e.g. /proc/sys/net/mpls/conf/eth0/input .
2024-12-13 15:36:45 +00:00
Daan De Meyer
d218ecc733 repart: Take configured minimum and maximum size into account for Minimize=
- Let's check if the minimum size we got is larger than the configured
maximum partition size and fail early if it is.
- Let's make sure for writable filesystems that we make the minimal
filesystem at least as large as the minimum partition size, to allow
creating minimal filesystems with a minimum size.
2024-12-13 15:10:29 +00:00
Daan De Meyer
12c29e5b3a Revert "repart: Drop unprivileged subvolumes logic for btrfs"
This adds back support for unprivileged btrfs subvolumes which
can be merged once btrfs-progs 6.12 is out.

This reverts commit 4d9ccdc9ae.
2024-12-13 14:05:32 +00:00
Daan De Meyer
18bb30c3b2
core: Bind mount notify socket to /run/host/notify in sandboxed units (#35573)
To be able to run systemd in a Type=notify transient unit, the notify
socket can't be bind mounted to /run/systemd/notify as systemd in the
transient unit wants to use that as its own notify socket which
conflicts with systemd on the host.

Instead, for sandboxed units, let's bind mount the notify socket to
/run/host/notify as documented in the container interface. Since we
don't guarantee a stable location for the notify socket and insist users
use $NOTIFY_SOCKET to get its path, this is safe to do.
2024-12-13 13:48:07 +00:00
Luca Boccassi
ed803ee195
journalctl: make --setup-keys honor --output=json and --quiet (#35507)
Closes #35503.
Closes #35504.
2024-12-13 13:40:09 +00:00
Daan De Meyer
284dd31e9d core: Bind mount notify socket to /run/host/notify in sandboxed units
To be able to run systemd in a Type=notify transient unit, the notify
socket can't be bind mounted to /run/systemd/notify as systemd in the
transient unit wants to use that as its own notify socket which conflicts
with systemd on the host.

Instead, for sandboxed units, let's bind mount the notify socket to
/run/host/notify as documented in the container interface. Since we don't
guarantee a stable location for the notify socket and insist users use
$NOTIFY_SOCKET to get its path, this is safe to do.
2024-12-13 13:37:02 +01:00
Daan De Meyer
5575bf5fac
core/namespace: several fixes for recently merged PRs (#35580)
Fixes #35546.
Fixes #35566.
2024-12-13 12:34:11 +00:00
Soumyadeep Ghosh
1d771e69b2 hwdb: move down touchpad toggle section from generic to product specific
adding `KEYBOARD_KEY_76` in generic section is causing a regression
in MSI GF63. Moving this down fixes.
This commit also adds a probable KEY Code for MSI GF63 touchpad toggling
2024-12-13 12:29:40 +00:00
Luca Boccassi
6dfd290031
core: Add PrivateUsers=full (#35183)
Recently, PrivateUsers=identity was added to support mapping the first
65536 UIDs/GIDs from parent to the child namespace and mapping the other
UID/GIDs to the nobody user.

However, there are use cases where users have UIDs/GIDs > 65536 and need
to do a similar identity mapping. Moreover, in some of those cases,
users want a full identity mapping from 0 -> UID_MAX.

To support this, we add PrivateUsers=full that does identity mapping for
all available UID/GIDs.

Note to differentiate ourselves from the init user namespace, we need to
set up the uid_map/gid_map like:
```
0 0 1
1 1 UINT32_MAX - 1
```

as the init user namedspace uses `0 0 UINT32_MAX` and some applications
- like systemd itself - determine if its a non-init user namespace based
on uid_map/gid_map files.

Note systemd will remove this heuristic in running_in_userns() in
version 258 (https://github.com/systemd/systemd/pull/35382) and uses
namespace inode. But some users may be running a container image with
older systemd < 258 so we keep this hack until version 259 for version
N-1 compatibility.

In addition to mapping the whole UID/GID space, we also set
/proc/pid/setgroups to "allow". While we usually set "deny" to avoid
security issues with dropping supplementary groups
(https://lwn.net/Articles/626665/), this ends up breaking dbus-broker
when running /sbin/init in full OS containers.

Fixes: #35168
Fixes: #35425
2024-12-13 12:25:13 +00:00
Florian Schmaus
718b31138b logind: let system-wide idle begin at the time logind was initialized
Initialize the start of the system-wide idle time with the time logind was
initialized and not with the start of the Unix epoch. This means that systemd
will not repport a unreasonable long idle time (around 54 years at the time of
writing this), especially at in the early boot, while no login manager session,
e.g,. gdm, had a chance to provide a more accurate start of the idle period.

Fixes #35163
2024-12-13 12:12:21 +00:00
Mike Yuan
8a1068931d
Couple small cleanups (#35593) 2024-12-13 13:01:27 +01:00
Daan De Meyer
1c43f92a2a
basic/fileio: two modernizations (#35559) 2024-12-13 11:49:12 +00:00
Luca Boccassi
e7fce6a370 shell-completion: add smbios11 verb to systemd-analyze
Follow-up for 8c5045f9b2
2024-12-13 11:43:48 +00:00
Luca Boccassi
8d20606eec mkosi: update debian commit reference
* e8b7c9a4dd Install 81-net-bridge.rules
* 50d2997a07 Install systemd-creds bash completion
* ff0c42823c test: fix flaky boot-and-services test
* 2a19dee4ba test: fix flaky boot-and-services test
* a15a0bfe60 Update changelog for 257-2 release
* c24eafcb7e Backport patches to fix test failures
* 29840f9b68 udev: install dmi_memory_id and its rules on riscv64
* 44893bdb32 Update changelog for 257-1 release
* 7f71d995fb Update symbols file for v257
* 2dd2b80499 Update upstream source from tag 'upstream/257'
* 51a3271a85 Update changelog for 257~rc3-1 release
* 8e687227c5 Update symbols for 257~rc3
* c9bae527d6 Drop patches, merged upstream
* e8cf329870 Update upstream source from tag 'upstream/257_rc3'
* 794457516d autopkgtest: fix one more tzdata dependency
* 16bb143da1 Bump version in tzdata dependency due to p-u upload
* f2ddf70604 sysctl: Add file trigger on /usr/lib/sysctl.d to restart systemd-sysctl
* 79260cb0f4 Increase minimum sections in stub PE header on arm64/armhf/riscv64 to 500
* ed3af24635 systemd-ukfy: recommend systemd-boot-efi for the stub
2024-12-13 11:43:23 +00:00
Mike Yuan
8abeebdf83 core/mount: don't keep cred mounts around after mounted
Follow-up for 6577cf1ba9
2024-12-13 10:29:27 +00:00