]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agoptyfwd: try to drain on exit only once 35752/head
Yu Watanabe [Wed, 25 Dec 2024 08:38:54 +0000 (17:38 +0900)] 
ptyfwd: try to drain on exit only once

Reading or writing a fd may fail with EBUSY, and the loop might run
without doing mostly nothing and the event loop may finish with ELOOP.

10 months agoptyfwd,run: process remaining outputs in IO event sources
Yu Watanabe [Wed, 25 Dec 2024 08:40:04 +0000 (17:40 +0900)] 
ptyfwd,run: process remaining outputs in IO event sources

This partially reverts 12807b5a49d1fe60434d473afe11ff81a4c92306.

Otherwise, reading or writing a fd in on_exit_event() handler may return
EBUSY, and the event loop may finish with -ELOOP.

Also, this makes drained() returns true if the PTY forwarder is already
disconnected, for safety. Hence, it is not necessary to re-introduce
pty_forward_is_done().

10 months agoptyfwd: fix infinite loop
Yu Watanabe [Wed, 25 Dec 2024 05:10:11 +0000 (14:10 +0900)] 
ptyfwd: fix infinite loop

This makes we exit from the loop in do_shovel() when
PTYForward.out_buffer_write_len is zero but PTYForward.out_buffer_full
is non-zero.

Fixes a bug introduced by 5e6a48bf99d2adb3c9d22414197a593f2aa8a121.
Fixes #35746.

10 months agoDrop legacy glibc version check and inclusion of linux/memfd.h (#35748)
Yu Watanabe [Wed, 25 Dec 2024 04:58:02 +0000 (13:58 +0900)] 
Drop legacy glibc version check and inclusion of linux/memfd.h (#35748)

10 months agodocs: Explicitly mention ~/.local/bin in section on installing mkosi
Daan De Meyer [Mon, 23 Dec 2024 20:30:32 +0000 (21:30 +0100)] 
docs: Explicitly mention ~/.local/bin in section on installing mkosi

10 months agodocs: Use meson compile instead of ninja
Daan De Meyer [Tue, 24 Dec 2024 08:53:53 +0000 (09:53 +0100)] 
docs: Use meson compile instead of ninja

"ninja -C build mkosi" doesn't actually work and fails because ninja
thinks the mkosi target does not exist. "meson compile -C build mkosi"
dpes work so let's use that instead.

Fixes #35741

10 months agopo: Translated using Weblate (Italian)
Salvatore Cocuzza [Tue, 24 Dec 2024 03:29:00 +0000 (04:29 +0100)] 
po: Translated using Weblate (Italian)

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/it/
Translation: systemd/main

10 months agotree-wide: drop inclusion of linux/memfd.h 35748/head
Mike Yuan [Tue, 24 Dec 2024 15:52:08 +0000 (16:52 +0100)] 
tree-wide: drop inclusion of linux/memfd.h

We carry our own definitions in missing_mman.h, and otherwise
sys/mman.h is employed. Let's drop the unneeded detection/inclusion
of linux/memfd.h hence.

10 months agobasic/missing_threads: drop glibc < 2.16 check
Mike Yuan [Tue, 24 Dec 2024 15:50:05 +0000 (16:50 +0100)] 
basic/missing_threads: drop glibc < 2.16 check

glibc 2.16 has been our baseline for ~10y
(c.f. 3dd26f3e3aa7fa0696d304e14551362133dd281f)

10 months agomachine: add debugging info to trace #35115
Ivan Kruglov [Fri, 20 Dec 2024 15:16:56 +0000 (16:16 +0100)] 
machine: add debugging info to trace #35115

10 months agomeson: sort source files
Yu Watanabe [Sat, 21 Dec 2024 16:36:54 +0000 (01:36 +0900)] 
meson: sort source files

10 months agoUse device3.xml for testing chid_match
Ani Sinha [Sun, 22 Dec 2024 14:03:04 +0000 (19:33 +0530)] 
Use device3.xml for testing chid_match

device3.xml was not used. Use it now.

10 months agosd-varlink: add sd_varlink_server_listen_name (#35697)
Thorsten Kukuk [Sat, 21 Dec 2024 07:53:07 +0000 (08:53 +0100)] 
sd-varlink: add sd_varlink_server_listen_name (#35697)

10 months agoshell-completion: add bash completion for userdbctl (#35720)
Joey Holtzman [Sun, 22 Dec 2024 17:24:12 +0000 (11:24 -0600)] 
shell-completion: add bash completion for userdbctl (#35720)

Closes #35660.

10 months agotest: answer 2nd mdadm --create question for compat with new version
Luca Boccassi [Sun, 22 Dec 2024 13:31:36 +0000 (13:31 +0000)] 
test: answer 2nd mdadm --create question for compat with new version

New version of mdadm now asks a second question, so send 'y' twice
to it in the test scripts

[    5.253483] TEST-64-UDEV-STORAGE.sh[684]: + echo y
[    5.254412] TEST-64-UDEV-STORAGE.sh[685]: + mdadm --create /dev/md/mdmirror --name mdmirror --uuid aaaaaaaa:bbbbbbbb:cccccccc:00000001 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm0 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm1 -v -f --level=1 --raid-devices=2
[    5.254759] TEST-64-UDEV-STORAGE.sh[685]: To optimalize recovery speed, it is recommended to enable write-indent bitmap, do you want to enable it now? [y/N]? mdadm: Note: this array has metadata at the start and
[    5.255085] TEST-64-UDEV-STORAGE.sh[685]:     may not be suitable as a boot device.  If you plan to
[    5.255418] TEST-64-UDEV-STORAGE.sh[685]:     store '/boot' on this device please ensure that
[    5.255745] TEST-64-UDEV-STORAGE.sh[685]:     your boot-loader understands md/v1.x metadata, or use
[    5.256285] TEST-64-UDEV-STORAGE.sh[685]:     --metadata=0.90
[    5.256672] TEST-64-UDEV-STORAGE.sh[685]: mdadm: size set to 64512K
[    5.257063] TEST-64-UDEV-STORAGE.sh[685]: Continue creating array [y/N]? mdadm: create aborted.

This is backward compatible with the older version that asks just one
question

10 months agoRemove leftover .gitmodules file
Daan De Meyer [Sat, 21 Dec 2024 20:21:42 +0000 (21:21 +0100)] 
Remove leftover .gitmodules file

10 months agomkosi: Fix authselect systemd-homed feature name
Daan De Meyer [Sat, 21 Dec 2024 18:10:42 +0000 (19:10 +0100)] 
mkosi: Fix authselect systemd-homed feature name

The feature name is with-systemd-homed, not with-homed.

10 months agosystemd-homed: Give access to /dev/btrfs-control
Daan De Meyer [Sat, 21 Dec 2024 16:52:03 +0000 (17:52 +0100)] 
systemd-homed: Give access to /dev/btrfs-control

Otherwise, we see "WARNING: failed to open /dev/btrfs-control,
skipping device registration: Operation not permitted" in systemd-homed's
logs when creating a btrfs on luks home.

10 months agounits: Order systemd-oomd after systemd-sysusers
Daan De Meyer [Sat, 21 Dec 2024 16:01:27 +0000 (17:01 +0100)] 
units: Order systemd-oomd after systemd-sysusers

systemd-sysusers might create the systemd-oom system user that
systemd-oomd runs under so let's order systemd-oomd after
systemd-sysusers.

10 months agohwdb: comment out the entry for Logitech MX Keys for Mac
Yu Watanabe [Fri, 20 Dec 2024 18:13:18 +0000 (03:13 +0900)] 
hwdb: comment out the entry for Logitech MX Keys for Mac

This effectively reverts the commit f70e5620b6ac319beac1d5ce26331bdc48d25daa,
as the entry seems to match multiple models.

Fixes #35691.

10 months agoimage-discovery: add per-user scope (#35510)
Lennart Poettering [Fri, 20 Dec 2024 21:12:35 +0000 (22:12 +0100)] 
image-discovery: add per-user scope (#35510)

10 months agopid1: complete per-user credentials support (#35536)
Lennart Poettering [Fri, 20 Dec 2024 21:12:08 +0000 (22:12 +0100)] 
pid1: complete per-user credentials support (#35536)

Fixes: #33887 #33796 #33318
10 months agoanalyze: extend CHID support to more types (#35699)
Lennart Poettering [Fri, 20 Dec 2024 21:11:39 +0000 (22:11 +0100)] 
analyze: extend CHID support to more types (#35699)

Let's implement the spec more comprehensively.

This is piece by piece work, There's more to do on the EFI side before
all CHID types are supported, but in userspace it should be reasonably
complete now.

10 months agoVarious mkosi improvements (#35684)
Daan De Meyer [Fri, 20 Dec 2024 20:24:51 +0000 (21:24 +0100)] 
Various mkosi improvements (#35684)

10 months agodocs: Simplify hacking documentation 35684/head
Daan De Meyer [Thu, 19 Dec 2024 10:45:01 +0000 (11:45 +0100)] 
docs: Simplify hacking documentation

Let's use "mkosi sandbox" in the docs so that users can build systemd
without having to install anything except mkosi. Using mkosi sandbox
will use tools and dependencies from the tools tree which is also used
in CI and thus has a higher chance of working from the first try compared
to whatever tools might be installed on the host system of a new contributor.

10 months agomkosi.clangd: Fail on command errors
Daan De Meyer [Thu, 19 Dec 2024 14:05:51 +0000 (15:05 +0100)] 
mkosi.clangd: Fail on command errors

10 months agomkosi.clangd: Don't pass --host if we're not using flatpak-spawn
Daan De Meyer [Thu, 19 Dec 2024 14:05:33 +0000 (15:05 +0100)] 
mkosi.clangd: Don't pass --host if we're not using flatpak-spawn

10 months agomkosi: Use build/ as extra search path by default
Daan De Meyer [Thu, 19 Dec 2024 10:43:01 +0000 (11:43 +0100)] 
mkosi: Use build/ as extra search path by default

Building systemd with mkosi generally requires a very recent version
of systemd which might not be installed on the host. Let's configure
mkosi to look for extra executables in the build/ directory by default
so that we prefer systemd executables from the build directory over those
on the host as those on the host are likely to be too old.

10 months agomkosi: Use tools tree by default
Daan De Meyer [Thu, 19 Dec 2024 10:41:40 +0000 (11:41 +0100)] 
mkosi: Use tools tree by default

Let's enable usage of a tools tree by default to simplify the setup
for new contributors and save them from having to install or upgrade
a bunch of extra tools to get mkosi working as expected.

10 months agomkosi: Enable EPEL for CentOS Stream tools tree
Daan De Meyer [Thu, 19 Dec 2024 15:49:59 +0000 (16:49 +0100)] 
mkosi: Enable EPEL for CentOS Stream tools tree

We need packages from EPEL to be able to build CentOS Stream images
with a CentOS Stream tools tree so enable it. This is broken on CentOS
Stream 10 but given using a CentOS Stream tools tree is broken without
EPEL as well, we might as well enable it and just wait until the packages
are added to EPEL 10.

10 months agomkosi: Add libz1 to opensuse tools tree
Daan De Meyer [Thu, 19 Dec 2024 13:43:48 +0000 (14:43 +0100)] 
mkosi: Add libz1 to opensuse tools tree

Without meson fails to configure properly.

10 months agomkosi: Add gdb to tools tree
Daan De Meyer [Thu, 19 Dec 2024 10:32:51 +0000 (11:32 +0100)] 
mkosi: Add gdb to tools tree

10 months agodocs: Move fuzzers documentation to test README.md
Daan De Meyer [Thu, 19 Dec 2024 10:26:25 +0000 (11:26 +0100)] 
docs: Move fuzzers documentation to test README.md

10 months agocoverage: Run on pull request in a few cases
Daan De Meyer [Fri, 20 Dec 2024 09:21:12 +0000 (10:21 +0100)] 
coverage: Run on pull request in a few cases

If we're changing the integration test wrapper or coverage.yml, let's
run the coverage workflow on PRs as well to make sure it doesn't break.

10 months agomkosi: Update to latest
Daan De Meyer [Thu, 19 Dec 2024 12:54:13 +0000 (13:54 +0100)] 
mkosi: Update to latest

10 months agoanalyze-chid: fully support all CHID types 35699/head
Lennart Poettering [Fri, 20 Dec 2024 11:21:01 +0000 (12:21 +0100)] 
analyze-chid: fully support all CHID types

This adds logic to read the missing SMBIOS fields from userspace, too.
With this we should have full CHID coverage now, matching fwupd's output
fully.

10 months agoanalyze-chid: split out code that reads smbios into helper
Lennart Poettering [Fri, 20 Dec 2024 11:20:09 +0000 (12:20 +0100)] 
analyze-chid: split out code that reads smbios into helper

10 months agoanalyze: C escape weird chars in SMBIOS fields
Lennart Poettering [Fri, 20 Dec 2024 11:13:43 +0000 (12:13 +0100)] 
analyze: C escape weird chars in SMBIOS fields

just in case, let's not write garbled crap to the TTY but escape and
potential weird chars before output.

10 months agochid: add missing CHID type definitions
Lennart Poettering [Fri, 20 Dec 2024 11:12:02 +0000 (12:12 +0100)] 
chid: add missing CHID type definitions

This add he missing CHID types to our tables, but doesn't add all
necessary code to calculate them yet.

This brings us closer to what the CHID spec documents, and what
"fupwdtool hwids" outputs.

10 months agoanalyze-chid: show friendly smbios field names
Lennart Poettering [Fri, 20 Dec 2024 11:10:55 +0000 (12:10 +0100)] 
analyze-chid: show friendly smbios field names

Some of the field names between kernel and smbios spec differ. Kinda
confusing. Let's use the smbios field names, to match the CHID spec,
which also uses them, and thus be least confusing, treating kernel
attribute fields as an internal Linux thing only.

10 months agoanalyze: not all smbios fields are always defined, deal with that
Lennart Poettering [Fri, 20 Dec 2024 11:09:41 +0000 (12:09 +0100)] 
analyze: not all smbios fields are always defined, deal with that

As per previous commit, accept that not all SMBIOS fields are alwaysa
available (or set, but empty), hence handle this gracefully and don't
generate relevant CHIDs, as per docs.

10 months agochid-fundamental: rework bit checking to use FLAGS_SET()
Lennart Poettering [Fri, 20 Dec 2024 17:13:16 +0000 (18:13 +0100)] 
chid-fundamental: rework bit checking to use FLAGS_SET()

10 months agochid-fundamental: use right type to iterate through smbios fields
Lennart Poettering [Fri, 20 Dec 2024 11:04:18 +0000 (12:04 +0100)] 
chid-fundamental: use right type to iterate through smbios fields

10 months agochid-fundamental: make namespace GUID static, too
Lennart Poettering [Fri, 20 Dec 2024 11:03:50 +0000 (12:03 +0100)] 
chid-fundamental: make namespace GUID static, too

10 months agochid-fundamental: not all SMBIOS fields are available on all systems
Lennart Poettering [Fri, 20 Dec 2024 11:02:33 +0000 (12:02 +0100)] 
chid-fundamental: not all SMBIOS fields are available on all systems

And the CHID documentation says that CHIDs that require fields that are
not available on the local system should not be generated. Follow that,
and generate a NULL CHID in that case (which we generally ignore
otherwise).

10 months agoupdate TODO 35510/head
Lennart Poettering [Mon, 9 Dec 2024 10:46:54 +0000 (11:46 +0100)] 
update TODO

10 months agodiscover-image: introduce per-user image directories
Lennart Poettering [Mon, 9 Dec 2024 10:38:05 +0000 (11:38 +0100)] 
discover-image: introduce per-user image directories

We nowadays support unprivileged invocation of systemd-nspawn +
systemd-vmspawn, but there was no support for discovering suitable disk
images (i.e. no per-user counterpart of /var/lib/machines). Add this
now, and hook it up everywhere.

Instead of hardcoding machined's, importd's, portabled's, sysupdated's
image discovery to RUNTIME_SCOPE_SYSTEM I introduced a field that make
the scope variable, even if this field is always initialized to
RUNTIME_SCOPE_SYSTEM for now. I think these four services should
eventually be updated to support a per-user concept too, this is
preparation for that, even though it doesn't outright add support for
this.

This is for the largest part not user visible, except for in nspawn,
vmspawn and the dissect tool. For the latter I added a pair of
--user/--system switches to select the discovery scope.

10 months agoupdate TODO 35536/head
Lennart Poettering [Tue, 10 Dec 2024 19:49:31 +0000 (20:49 +0100)] 
update TODO

10 months agoman: document the new per-use credstore paths
Lennart Poettering [Tue, 10 Dec 2024 20:34:06 +0000 (21:34 +0100)] 
man: document the new per-use credstore paths

(And some other minor tweaks)

10 months agotest: add integration test that makes sure unpriv creds work correctly
Lennart Poettering [Tue, 10 Dec 2024 19:50:19 +0000 (20:50 +0100)] 
test: add integration test that makes sure unpriv creds work correctly

This checks both the per-user credstore directory logic, and that
unprivileged, encrypted credentials work.

10 months agopid1: add support for decrypting per-user credentials
Lennart Poettering [Tue, 10 Dec 2024 13:56:18 +0000 (14:56 +0100)] 
pid1: add support for decrypting per-user credentials

When I added support for unprivileged credentials I apparently never
hooked them up to service management correctly. Let's fix that.

Fixes: #33796 #33318
10 months agoexecute: introduce a user-scoped credstore
Lennart Poettering [Tue, 10 Dec 2024 12:35:39 +0000 (13:35 +0100)] 
execute: introduce a user-scoped credstore

Fixes: #33887
10 months agosd-path: expose credential store in sd-path
Lennart Poettering [Tue, 10 Dec 2024 13:34:41 +0000 (14:34 +0100)] 
sd-path: expose credential store in sd-path

10 months agosystemd-path: add the usual ANSI sequences to --help text
Lennart Poettering [Tue, 10 Dec 2024 20:38:37 +0000 (21:38 +0100)] 
systemd-path: add the usual ANSI sequences to --help text

10 months agosystemd-path: guarantee that tool exit status is zero on success
Lennart Poettering [Tue, 10 Dec 2024 13:05:04 +0000 (14:05 +0100)] 
systemd-path: guarantee that tool exit status is zero on success

Let's not inherit the error code from an earlier function invocation.

10 months agosystemd-path: order all listed paths by their ID alphabetically
Lennart Poettering [Tue, 10 Dec 2024 13:01:13 +0000 (14:01 +0100)] 
systemd-path: order all listed paths by their ID alphabetically

Let's add some system to the madness, given we added user-specific dirs
to the end of the list, but they should really be listed together with
the other user-specific ones.

10 months agosd-path: don't chop off trailing slash in sd_path apis, when user provided them
Lennart Poettering [Tue, 10 Dec 2024 12:37:56 +0000 (13:37 +0100)] 
sd-path: don't chop off trailing slash in sd_path apis, when user provided them

This is a minor compat break, but given the slow adoption of the
sd-path.h APIs I think it's one we should take. Basically, the idea is
that if the user provides a suffix path with a trailing slash (thus
encoding in the path that the last element must be a dir), we should
keep it in place, and not suppress it, in order to not willy nilly
reduce the amount of information contained in the path.

Simplifications that do not alter meaning, and do not suppress
information should be fine to apply to a path, but otherwise we really
should be conservative on this.

10 months agopid1: normalize oom error handling a bit
Lennart Poettering [Tue, 10 Dec 2024 10:10:30 +0000 (11:10 +0100)] 
pid1: normalize oom error handling a bit

10 months agopo: Translated using Weblate (Finnish)
Ricky Tigg [Fri, 20 Dec 2024 15:38:37 +0000 (16:38 +0100)] 
po: Translated using Weblate (Finnish)

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fi/
Translation: systemd/main

10 months agoAdd .venv to gitignore
Septatrix [Fri, 20 Dec 2024 14:44:20 +0000 (15:44 +0100)] 
Add .venv to gitignore

This directory is commonly used for virtual Python environments.
These are useful when developing to install different Python versions
as well as install tooling like mkosi and mypy in an isolated fashion
without influencing the global system.

10 months agocore/device: handle ID_PROCESSING udev property (#35351)
Lennart Poettering [Fri, 20 Dec 2024 09:12:39 +0000 (10:12 +0100)] 
core/device: handle ID_PROCESSING udev property (#35351)

Continuation of #35332.

10 months agodebug-generator: add a kernel cmdline option to pause the boot process (#35410)
Daan De Meyer [Fri, 20 Dec 2024 09:04:41 +0000 (10:04 +0100)] 
debug-generator: add a kernel cmdline option to pause the boot process (#35410)

Introduce the `systemd.break=` kernel command line option to allow
stopping the boot process at a certain point and spawn a debug shell.
After exiting this shell, the system will resume booting.

It accepts the following values:
- `pre-udev`: before starting to process kernel uevents (initrd and
host).
- `pre-basic`: before leaving early boot and regular services start
(initrd and host).
- `pre-mount`: before the root filesystem is mounted (initrd).
- `pre-switch-root`: before switching root (initrd).

10 months ago[RFC] better naming for Azure MANA network devices (#34255)
Lennart Poettering [Fri, 20 Dec 2024 08:52:40 +0000 (09:52 +0100)] 
[RFC] better naming for Azure MANA network devices (#34255)

The Azure MANA folks would like the PCI domain to be suppressed from
naming network interfaces. Let's introduce a somewhat generic way to do
this, without hardcoding anything to Azure.

Specifically: we'll ship a new hwdb entry that sets a new
ID_NET_NAME_INCLUDE_DOMAIN=0 property on relevant MANA devices. Then we
make net_id look for that property, and if it is set we simply suppress
the PCI domain.

(Untested as of now, needs feedback from Azure MANA folks that this
actually works and does what is requested here).

10 months agomkosi: move config options
Matteo Croce [Thu, 19 Dec 2024 18:51:42 +0000 (19:51 +0100)] 
mkosi: move config options

Move some config option in the right section, fixes the following warning:
```
mkosi.conf: Setting Credentials should be configured in [Runtime], not [Host].
mkosi.conf: Setting RuntimeBuildSources should be configured in [Runtime], not [Host].
mkosi.conf: Setting RuntimeScratch should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuSmp should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuSwtpm should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuVsock should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuKvm should be configured in [Runtime], not [Host].
```

10 months agoaudit-util: rename output parameter
Yu Watanabe [Fri, 20 Dec 2024 06:11:47 +0000 (15:11 +0900)] 
audit-util: rename output parameter

To make them consistent with in audit-util.c.

Follow-up for 7e02ee98d86702b8e7055f0a6d8e6ea48267ad23.

10 months agoTEST-71-HOSTNAME: do not start user session
Yu Watanabe [Fri, 20 Dec 2024 05:55:10 +0000 (14:55 +0900)] 
TEST-71-HOSTNAME: do not start user session

The user session may trigger hostnamed, and the job of stopping
hostnamed may be cancelled, and the test may fail:
```
[ 4633.613578] TEST-71-HOSTNAME.sh[175]: + stop_hostnamed
[ 4633.613578] TEST-71-HOSTNAME.sh[175]: + systemctl stop systemd-hostnamed.service
[ 4633.664670] systemd[1]: Stopping systemd-hostnamed.service - Hostname Service...
[ 4636.022277] systemd-logind[121]: New session c2 of user root.
[ 4636.032532] systemd[1]: Created slice user-0.slice - User Slice of UID 0.
[ 4636.042675] systemd[1]: Starting user-runtime-dir@0.service - User Runtime Directory /run/user/0...
[ 4636.176140] systemd[1]: Finished user-runtime-dir@0.service - User Runtime Directory /run/user/0.
[ 4636.202951] systemd[1]: Starting user@0.service - User Manager for UID 0...
[ 4636.292204] systemd-logind[121]: New session c3 of user root.
[ 4636.300065] (systemd)[268]: pam_unix(systemd-user:session): session opened for user root(uid=0) by root(uid=0)
[ 4636.757667] systemd[268]: Queued start job for default target default.target.
[ 4636.774419] systemd[268]: Created slice app.slice - User Application Slice.
[ 4636.774579] systemd[268]: Started systemd-tmpfiles-clean.timer - Daily Cleanup of User's Temporary Directories.
[ 4636.774747] systemd[268]: Reached target paths.target - Paths.
[ 4636.776418] systemd[268]: Reached target sysinit.target - System Initialization.
[ 4636.776604] systemd[268]: Reached target timers.target - Timers.
[ 4636.784997] systemd[268]: Starting dbus.socket - D-Bus User Message Bus Socket...
[ 4636.799472] systemd[268]: Starting systemd-tmpfiles-setup.service - Create User Files and Directories...
[ 4637.027125] systemd[268]: Finished systemd-tmpfiles-setup.service - Create User Files and Directories.
[ 4637.031721] systemd[268]: Listening on dbus.socket - D-Bus User Message Bus Socket.
[ 4637.036189] systemd[268]: Reached target sockets.target - Sockets.
[ 4637.036373] systemd[268]: Reached target basic.target - Basic System.
[ 4637.036558] systemd[268]: Reached target default.target - Main User Target.
[ 4637.036646] systemd[268]: Startup finished in 702ms.
[ 4637.049075] systemd[1]: Started user@0.service - User Manager for UID 0.
[ 4637.075263] systemd[1]: Started session-c2.scope - Session c2 of User root.
[ 4637.084917] login[136]: pam_unix(login:session): session opened for user root(uid=0) by root(uid=0)
[ 4637.117348] login[136]: ROOT LOGIN ON pts/0
[ 4637.238572] systemctl[261]: Job for systemd-hostnamed.service canceled.
[ 4637.290369] systemd[1]: TEST-71-HOSTNAME.service: Main process exited, code=exited, status=1/FAILURE
```

Fixes #35643.

10 months agodebug-generator: add a kernel cmdline option to pause the boot process 35410/head
Antonio Alvarez Feijoo [Fri, 20 Dec 2024 07:51:23 +0000 (08:51 +0100)] 
debug-generator: add a kernel cmdline option to pause the boot process

Introduce the `systemd.break=` kernel command line option to allow stopping the
boot process at a certain point and spawn a debug shell. After exiting this
shell, the system will resume booting.

It accepts the following values:
- `pre-udev`: before starting to process kernel uevents (initrd and host).
- `pre-basic`: before leaving early boot and regular services start (initrd and
host).
- `pre-mount`: before the root filesystem is mounted (initrd).
- `pre-switch-root`: before switching root (initrd).

10 months agoman/debug-generator: add a section for kernel command line options
Antonio Alvarez Feijoo [Fri, 29 Nov 2024 10:29:17 +0000 (11:29 +0100)] 
man/debug-generator: add a section for kernel command line options

10 months agocapability-util: generalize helper to acquire local caps (#35403)
Yu Watanabe [Fri, 20 Dec 2024 02:52:24 +0000 (11:52 +0900)] 
capability-util: generalize helper to acquire local caps (#35403)

This generalizes and modernizes the code to acquire set of local caps,
based on the code for this in the condition logic. Uses PidRef, and
acquires the full quintuplet of caps.

This can be considered preparation to one day maybe build without
libcap.

10 months agoanalyze: add "chid" verb to display CHIDs of the local system (#35175)
Yu Watanabe [Fri, 20 Dec 2024 02:47:03 +0000 (11:47 +0900)] 
analyze: add "chid" verb to display CHIDs of the local system (#35175)

We already have the code for it, expose it in systemd-analyze, because
it's useful.

10 months agoSmall fixes to nspawn and other stuff (#35686)
Yu Watanabe [Fri, 20 Dec 2024 02:03:59 +0000 (11:03 +0900)] 
Small fixes to nspawn and other stuff (#35686)

Split out ouf #35685.

10 months agoTEST-17: add test case for ID_PROCESSING flag on add uevent 35351/head
Yu Watanabe [Mon, 25 Nov 2024 19:11:28 +0000 (04:11 +0900)] 
TEST-17: add test case for ID_PROCESSING flag on add uevent

Also, check the state of the device units on change event.

10 months agocore/device: handle ID_PROCESSING udev property
Yu Watanabe [Mon, 25 Nov 2024 16:19:35 +0000 (01:19 +0900)] 
core/device: handle ID_PROCESSING udev property

If an enumerated device has ID_PROCESSING=1 property, and the service
manager does not know if the device has been processed by udevd
previously (that is, Device.deserialized_found does not have
DEVICE_FOUND_UDEV), then drop DEVICE_FOUND_UDEV flag from the device and
make the device not enter the active state.

Follow-up for 405be62f05d76f1845f347737b5972158c79dd3e, which was
reverted by c4fc22c4defc5983e53f4ce048e15ea7d31e6a75.

10 months agocore/device: use path_equal() to compare sysfs path
Yu Watanabe [Mon, 16 Dec 2024 16:42:16 +0000 (01:42 +0900)] 
core/device: use path_equal() to compare sysfs path

The hashmap Manager.devices_by_sysfs uses path_hash_ops.
Let's consistent compare function.

10 months agocore/device: rename output parameters of device_setup_units() to ret_xyz
Yu Watanabe [Mon, 25 Nov 2024 13:48:37 +0000 (22:48 +0900)] 
core/device: rename output parameters of device_setup_units() to ret_xyz

No functional change, just refactoring.

10 months agoudev: support reloading udev.conf (#35458)
Yu Watanabe [Fri, 20 Dec 2024 00:00:48 +0000 (09:00 +0900)] 
udev: support reloading udev.conf (#35458)

This makes systemd-udevd reload udev.conf when explicitly requested by
e.g. `udevadm control --reload`.

10 months agoptyfwd: reset writable/readable flag before shovel() on exit
Yu Watanabe [Thu, 19 Dec 2024 03:22:00 +0000 (12:22 +0900)] 
ptyfwd: reset writable/readable flag before shovel() on exit

Follow-up for 12807b5a49d1fe60434d473afe11ff81a4c92306.

Otherwise, if a call of shovel() disabled the flags, the subsequent
calls do nothing even if there is something we need to read or write.

Fixes the following error:
```
Dec 19 02:19:39 run0[5618]: Error on PTY forwarding logic: Too many levels of symbolic links
```

10 months agomachine: make TEST-13-NSPAWN wqlong-running code more verbose
Ivan Kruglov [Wed, 18 Dec 2024 17:50:35 +0000 (18:50 +0100)] 
machine: make TEST-13-NSPAWN wqlong-running code more verbose

Need this to debug https://github.com/systemd/systemd/issues/35115

10 months agoMinor fixes in man pages, example scripts, error log (#35683)
Luca Boccassi [Thu, 19 Dec 2024 17:08:13 +0000 (17:08 +0000)] 
Minor fixes in man pages, example scripts, error log (#35683)

No functional changes.

10 months agonspawn: switch to read_virtual_file() for reading audit loginuid 35686/head
Lennart Poettering [Thu, 14 Nov 2024 11:25:22 +0000 (12:25 +0100)] 
nspawn: switch to read_virtual_file() for reading audit loginuid

10 months agonsresource: print nicer error message when trying to acquire an unpriv user ns range...
Lennart Poettering [Tue, 12 Nov 2024 13:19:09 +0000 (14:19 +0100)] 
nsresource: print nicer error message when trying to acquire an unpriv user ns range where this isn't possible

10 months agomount-util: add debug message to make_userns() failure
Lennart Poettering [Thu, 19 Dec 2024 13:27:03 +0000 (14:27 +0100)] 
mount-util: add debug message to make_userns() failure

10 months agomount-util: add debug output when we switched root
Lennart Poettering [Mon, 25 Nov 2024 10:35:11 +0000 (11:35 +0100)] 
mount-util: add debug output when we switched root

10 months agonspawn: trivial improvements
Lennart Poettering [Wed, 13 Nov 2024 11:15:08 +0000 (12:15 +0100)] 
nspawn: trivial improvements

10 months agonspawn: rename pin_fully_visible_fs() → pin_fully_visible_api_fs()
Lennart Poettering [Mon, 25 Nov 2024 10:32:35 +0000 (11:32 +0100)] 
nspawn: rename pin_fully_visible_fs() → pin_fully_visible_api_fs()

This function pins the *API* FS, i.e. /proc/ + /sys/, not just any fs.
Hence clarify this in the name.

(At least we call these two fs "API (V)FS" in our codebase, hence
continue to do so here)

10 months agonspawn: add some additional useful debug logging
Lennart Poettering [Mon, 25 Nov 2024 10:54:21 +0000 (11:54 +0100)] 
nspawn: add some additional useful debug logging

10 months agonspawn: make unexpected mkdir() failures fatal
Lennart Poettering [Mon, 25 Nov 2024 11:08:59 +0000 (12:08 +0100)] 
nspawn: make unexpected mkdir() failures fatal

THis is just to make things easier to debug.

10 months agonspawn: rename 'fd' variable to something more descriptive
Lennart Poettering [Mon, 25 Nov 2024 11:18:14 +0000 (12:18 +0100)] 
nspawn: rename 'fd' variable to something more descriptive

10 months agonspawn: use DEVNUM_FORMAT_STR/DEVNUM_FORMAT_VAL more
Lennart Poettering [Thu, 19 Dec 2024 13:26:14 +0000 (14:26 +0100)] 
nspawn: use DEVNUM_FORMAT_STR/DEVNUM_FORMAT_VAL more

10 months agoman/sysupdate.features: fix typos 35683/head
Matthias Lisin [Thu, 19 Dec 2024 11:04:24 +0000 (12:04 +0100)] 
man/sysupdate.features: fix typos

10 months agosysupdate: fix args order of formatted error
Matthias Lisin [Thu, 19 Dec 2024 10:30:13 +0000 (11:30 +0100)] 
sysupdate: fix args order of formatted error

10 months agoman/sysupdate.d: fix wrong PathRelativeTo value
Matthias Lisin [Thu, 19 Dec 2024 09:32:52 +0000 (10:32 +0100)] 
man/sysupdate.d: fix wrong PathRelativeTo value

10 months agoman: fix args order for udevadm info cmd
Matthias Lisin [Wed, 16 Oct 2024 05:02:21 +0000 (07:02 +0200)] 
man: fix args order for udevadm info cmd

10 months agoTEST-17: use 'udevadm control --reload' or 'systemctl reload systemd-udevd.service... 35458/head
Yu Watanabe [Tue, 3 Dec 2024 21:34:43 +0000 (06:34 +0900)] 
TEST-17: use 'udevadm control --reload' or 'systemctl reload systemd-udevd.service' for reloading udev.conf

These should be equivalent. For coverage, one subtest uses systemctl and
another uses udevadm.

10 months agoudev: also reload udev.conf when explicitly requested
Yu Watanabe [Tue, 3 Dec 2024 19:29:13 +0000 (04:29 +0900)] 
udev: also reload udev.conf when explicitly requested

When reloading is explicitly requested, e.g. by 'udevadm control --reload',
then also reload udev.conf.

10 months agoudev: reload .rules files and builtins only when necessary
Yu Watanabe [Tue, 3 Dec 2024 19:31:31 +0000 (04:31 +0900)] 
udev: reload .rules files and builtins only when necessary

Previously, even if e.g. .rules files are unchanged, all .rules files
are reloaded when other kind of config files like .link files or
.hwdb.bin are changed, vice versa.

10 months agoudev: move config parsers and related things to udev-config.c (#35624)
Yu Watanabe [Thu, 19 Dec 2024 09:41:52 +0000 (18:41 +0900)] 
udev: move config parsers and related things to udev-config.c (#35624)

No functional change, just refactoring and preparation for later
changes.

10 months agoudev-config: introduce UdevConfig 35624/head
Yu Watanabe [Tue, 3 Dec 2024 17:26:02 +0000 (02:26 +0900)] 
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.

10 months agoudev: move parsers for config file, kerenel command line, and positional arguments...
Yu Watanabe [Tue, 3 Dec 2024 17:33:47 +0000 (02:33 +0900)] 
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.

10 months agoukify: Fix regression in --no-sign-kernel flag
Thomas Hebb [Wed, 18 Dec 2024 16:08:17 +0000 (11:08 -0500)] 
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 02eabaffe98c
("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 02eabaffe98c
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: 02eabaffe98c ("ukify: Add a unified interface for signing tools")