]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agotest: add test case for issue #36031 37465/head
Yu Watanabe [Thu, 15 May 2025 04:45:13 +0000 (13:45 +0900)] 
test: add test case for issue #36031

5 months agocore: introduce Unit.dependency_generation counter and restart loop when dependency...
Yu Watanabe [Thu, 15 May 2025 03:34:35 +0000 (12:34 +0900)] 
core: introduce Unit.dependency_generation counter and restart loop when dependency is updated in the loop

When starting unit A, a dependent unit B may be loaded if it is not
loaded yet, and the dependencies in unit A may be updated.
As Hashmap does not allow a new entry to be added in a loop, we need to
restart loop in such case.

Fixes a bug introduced by cda667722c2218cf1a0185284d2a87f8a25f1b2d.
Fixes #36031.

5 months agocore/transaction: do not override unit load state when unit_load() failed
Yu Watanabe [Tue, 20 May 2025 19:38:07 +0000 (04:38 +0900)] 
core/transaction: do not override unit load state when unit_load() failed

When unit_load() failed for some reasons, previously we overrided the
load state with UNIT_NOT_FOUND, but we did not update the
Unit.fragment_not_found_timestamp_hash. So, the unit may be loaded
multiple times when the unit is in a dependency list of another unit,
as manager_unit_cache_should_retry_load() will be true again even on
next call.
Let's not override the unit state set by unit_load().

Note, after unit_load(), the unit state should not be UNIT_STUB.
Let's also add the assertion about that.

This change is important when combined with the next commit, as with the
next commit we will restart the FOREACH_UNIT_DEPENDENCY() loop if an unit
is reloaded, hence overriding load state with UNIT_NOT_FOUND may cause
infinit loop.

5 months agocore/transaction: drop redundant call of bus_unit_validate_load_state()
Yu Watanabe [Tue, 20 May 2025 19:32:09 +0000 (04:32 +0900)] 
core/transaction: drop redundant call of bus_unit_validate_load_state()

The function manager_unit_cache_should_retry_load() reutrns true only
when the unit state is UNIT_NOT_FOUND. Hence, it is not necessary to
call bus_unit_validate_load_state() before checking
manager_unit_cache_should_retry_load().

5 months agocore/transaction: fix comment
Yu Watanabe [Thu, 15 May 2025 00:14:07 +0000 (09:14 +0900)] 
core/transaction: fix comment

5 months agocore/transaction: rename ret -> job
Yu Watanabe [Thu, 15 May 2025 00:10:36 +0000 (09:10 +0900)] 
core/transaction: rename ret -> job

5 months agoNEWS: fix typo
Yu Watanabe [Wed, 28 May 2025 19:03:00 +0000 (04:03 +0900)] 
NEWS: fix typo

5 months agoNEWS: fix typos and formatting
Luca Boccassi [Wed, 28 May 2025 18:49:56 +0000 (19:49 +0100)] 
NEWS: fix typos and formatting

5 months agojournal-gatewayd: add /boots endpoint (#37574)
Jan Čermák [Wed, 28 May 2025 18:33:03 +0000 (20:33 +0200)] 
journal-gatewayd: add /boots endpoint (#37574)

Add endpoint for listing boots. Output format mimics `journalctl
--list-boots -o json`, so it's a plain array containing index, boot ID
and timestamps of the first and last entry. Initial implementation
returns boots ordered starting with the current one and doesn't allow
any filtering (i.e. equivalent of --lines argument).

Fixes: #37573
5 months agoMan page fixes (#37645)
Luca Boccassi [Wed, 28 May 2025 18:15:46 +0000 (19:15 +0100)] 
Man page fixes (#37645)

5 months agoNEWS: fix typo, reorganize a few entries
Mike Yuan [Wed, 28 May 2025 17:24:49 +0000 (19:24 +0200)] 
NEWS: fix typo, reorganize a few entries

5 months agoupdate TODO
Lennart Poettering [Wed, 28 May 2025 16:28:35 +0000 (18:28 +0200)] 
update TODO

5 months agoupdate NEWS in preparation for v258
Lennart Poettering [Wed, 28 May 2025 14:29:18 +0000 (16:29 +0200)] 
update NEWS in preparation for v258

5 months agopo: Translated using Weblate (Dutch)
Tim Vangehugten [Wed, 28 May 2025 09:31:44 +0000 (09:31 +0000)] 
po: Translated using Weblate (Dutch)

Currently translated at 92.2% (237 of 257 strings)

Co-authored-by: Tim Vangehugten <timvangehugten@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/nl/
Translation: systemd/main

5 months agoman: better tags, more links, minor grammar and formatting improvements 37645/head
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:20:50 +0000 (15:20 +0200)] 
man: better tags, more links, minor grammar and formatting improvements

Closes https://github.com/systemd/systemd/issues/35751.

5 months agoman/systemd.network: reword description of MulticastIGMPVersion=
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:31:19 +0000 (15:31 +0200)] 
man/systemd.network: reword description of MulticastIGMPVersion=

5 months agoman/systemd.timer: change to positive wording
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:30:20 +0000 (15:30 +0200)] 
man/systemd.timer: change to positive wording

5 months agoman: reword descriptions of numerical fields
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:30:05 +0000 (15:30 +0200)] 
man: reword descriptions of numerical fields

A "string" is a concept in C. In a text-based API, this is implicit, especially
if we say that something was "formatted". So change occurences of "decimal
string" to just "decimal". Similarly, "numerics" is unclear, say "digits".

Also, a "timestamp is in a clock" just sounds wrong. Reword those sentences.

5 months agoman/systemd-resolved: update description of routing
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:25:47 +0000 (15:25 +0200)] 
man/systemd-resolved: update description of routing

5 months agoman/systemd-analyze: rewrite "Exit status" section
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:25:23 +0000 (15:25 +0200)] 
man/systemd-analyze: rewrite "Exit status" section

5 months agoman/pam_systemd: use <constant> consistently
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:23:48 +0000 (15:23 +0200)] 
man/pam_systemd: use <constant> consistently

For some reason, <constant> and <literal> were used interchangeably.

5 months agoman: introduce openssl as man page provider and use it for ukify.1
Zbigniew Jędrzejewski-Szmek [Wed, 28 May 2025 13:23:03 +0000 (15:23 +0200)] 
man: introduce openssl as man page provider and use it for ukify.1

5 months agonetwork: fix handling of ENODATA when reading IFLA_MASTER attribute (#37633)
Luca Boccassi [Wed, 28 May 2025 11:20:00 +0000 (12:20 +0100)] 
network: fix handling of ENODATA when reading IFLA_MASTER attribute (#37633)

Fixes #37629.

5 months agosd-bus: rename internal structs and enums
Yu Watanabe [Wed, 28 May 2025 02:14:41 +0000 (11:14 +0900)] 
sd-bus: rename internal structs and enums

This renames e.g. struct bus_body_part -> BusMessageBodyPart to
follow our usual coding style. Also, several struct and enum
declarations are moved to relevant headers.
Also, this introduces bus-forward.h.

5 months agozsh-completion: improve systemd-run
Eisuke Kawashima [Tue, 27 May 2025 06:43:07 +0000 (15:43 +0900)] 
zsh-completion: improve systemd-run

- add missed options
- improve completion for property

5 months agocgroup-util: drop CGROUP_MASK_EXTEND_JOINED; move CGROUP_CPU_SHARES/BLKIO* to nspawn...
Yu Watanabe [Wed, 28 May 2025 00:50:05 +0000 (09:50 +0900)] 
cgroup-util: drop CGROUP_MASK_EXTEND_JOINED; move CGROUP_CPU_SHARES/BLKIO* to nspawn-oci (#37639)

5 months agocore/exec-invoke: don't set $TMPDIR if sandboxing is disabled (#37637)
Yu Watanabe [Wed, 28 May 2025 00:46:06 +0000 (09:46 +0900)] 
core/exec-invoke: don't set $TMPDIR if sandboxing is disabled (#37637)

Follow-ups for #37271.

5 months agocgroup-util: drop CGROUP_MASK_EXTEND_JOINED 37639/head
Mike Yuan [Tue, 27 May 2025 15:42:02 +0000 (17:42 +0200)] 
cgroup-util: drop CGROUP_MASK_EXTEND_JOINED

Also kill the "compat pair invalidation" logic in unit_invalidate_cgroup()

5 months agocgroup-util: move CGROUP_CPU_SHARES/BLKIO* to nspawn-oci
Mike Yuan [Tue, 27 May 2025 15:06:36 +0000 (17:06 +0200)] 
cgroup-util: move CGROUP_CPU_SHARES/BLKIO* to nspawn-oci

These are only used for translation from OCI metadata
to cgroup v2 values.

5 months agobus-print-properties: drop *CPUShares formatter
Mike Yuan [Tue, 27 May 2025 15:00:49 +0000 (17:00 +0200)] 
bus-print-properties: drop *CPUShares formatter

5 months agotest-execute: add test case for PrivateTmp=disconnected + DefaultDependencies=no... 37637/head
Mike Yuan [Tue, 27 May 2025 21:15:10 +0000 (23:15 +0200)] 
test-execute: add test case for PrivateTmp=disconnected + DefaultDependencies=no + sandboxing disabled via '+' prefix

5 months agocore/exec-invoke: don't set $TMPDIR if sandboxing is disabled
Mike Yuan [Tue, 27 May 2025 20:35:03 +0000 (22:35 +0200)] 
core/exec-invoke: don't set $TMPDIR if sandboxing is disabled

Follow-up for 6156bec7a464815084fa5218fe782ea6cb20ad52

5 months agotimedate: print better errors when systemd-timesyncd.service unavailable
Nick Rosbrook [Fri, 23 May 2025 21:10:02 +0000 (17:10 -0400)] 
timedate: print better errors when systemd-timesyncd.service unavailable

If the error is a common bus error indicating the service is not
available, print a more user-friendly message indicating so.

5 months agoshared: add optional error parameter in bus_print_all_properties()
Nick Rosbrook [Tue, 27 May 2025 15:58:29 +0000 (11:58 -0400)] 
shared: add optional error parameter in bus_print_all_properties()

While here, remove the unused found_properties parameter.

This is preparation for another commit.

5 months agotest-network: replace unnecessary assertRegex() with assertIn() 37633/head
Yu Watanabe [Tue, 27 May 2025 14:42:33 +0000 (23:42 +0900)] 
test-network: replace unnecessary assertRegex() with assertIn()

This fixes the following warning:
```
/tmp/systemd/test/test-network/systemd-networkd-tests.py:5107: SyntaxWarning: invalid escape sequence '\.'
  self.assertRegex(output, 'inet 10\.234\.77\.111/32.*dummy98')
```

Follow-up for 6479204e567cd55e1bfc5894131fba80ea68a780.

5 months agotest-network: add test case for issue #37629
Yu Watanabe [Tue, 27 May 2025 14:31:48 +0000 (23:31 +0900)] 
test-network: add test case for issue #37629

5 months agonetwork/link: update state file when master ifindex is changed
Yu Watanabe [Tue, 27 May 2025 17:09:52 +0000 (02:09 +0900)] 
network/link: update state file when master ifindex is changed

If master ifindex is non-zero, then the carrier state and operational
state of the interface may be the enslaved state.
As the operational state is saved in link state file, and read by
wait-online, we need to update the state file when the master ifindex is
changed.

5 months agonetwork/link: ENODATA from reading IFLA_MASTER when an interface has no master
Yu Watanabe [Tue, 27 May 2025 14:17:40 +0000 (23:17 +0900)] 
network/link: ENODATA from reading IFLA_MASTER when an interface has no master

When an interface leaved from the master interface, then reading
IFLA_MASTER attribute causes ENODATA. When the interface was previously
enslaved to another interface, we need to remove reference to the
interface from the previous master interface.

This is especially important when
```
ip link set dev eth0 nomaster
```
is called.

Fixes a bug introduced by 0d411b7f8f5407e9ce84dcb4ede0b029ade7fede (v249).
Fixes #37629.

5 months agocgroup-util: minor cleanups (#37630)
Yu Watanabe [Tue, 27 May 2025 17:19:21 +0000 (02:19 +0900)] 
cgroup-util: minor cleanups (#37630)

5 months agomkosi: update mkosi commit reference to 5e739ef1ed02a4f3b6ae64e50a8ee186cbcb21c2...
Daan De Meyer [Tue, 27 May 2025 16:31:48 +0000 (18:31 +0200)] 
mkosi: update mkosi commit reference to 5e739ef1ed02a4f3b6ae64e50a8ee186cbcb21c2 (#37632)

5e739ef1ed mkosi-initrd: Optionally match t64 suffix for tss2
libraries
*   ec70393077 Merge pull request https://github.com/systemd/mkosi/pull/3742 from DaanDeMeyer/man
|\
| * 94cc136fbe mkosi-tools: Install man tool and pages as part of misc
profile
| * eda2ed533d Enforce C.UTF-8 locale for all commands we run
* | 9821e9a3e3 sandbox: Support using mkosi-sandbox as a library
* | 4145382edf Serialize pid in state and check if still exists on load
* |   3d119cba07 Merge pull request https://github.com/systemd/mkosi/pull/3736 from DaanDeMeyer/rpm-gpgkey
|\ \
| |/
|/|
| * 0a5d87b7bb Only pick up /etc/pki/tls and /etc/pki/ca-trust as
certificate dirs
| * c30eee187f Look for rpm gpg keys from inside the sandbox
|/
ef2842dfea Fix version bump check if image version was passed on CLI
12b6251153 apt: Install apt sources if apt was installed via base tree
a0b4e1af9a Make sure git doesn't fail when running as root
585a47705d repart: use --append-fstab=auto if available
cec6ae1dda sandbox: handle case where dev node for tty doesn't exist
a60dade823 initrd: shadow-utils removal is only necessary on old
Fedora
ca11acbd5b Use SPDX identifier instead of file path for license in
pyproject.toml
4d031bc57d Revert license-files property
*   c80dd09008 Merge pull request https://github.com/systemd/mkosi/pull/3722 from behrmann/versiontweaks
|\
| * c76e5dc4bc make version test more readable
| * 90ba99dde1 version: add __repr__ to GenericVersion
|/
dd794ec832 Fix licenses path in pyproject.toml
*   7eeb749840 Merge pull request https://github.com/systemd/mkosi/pull/3702 from aafeijoo-suse/initrd-kmp
|\
| * 565b905aa1 mkosi-initrd: handle symlinks under weak-updates
| * a83ccc10c7 mkosi-initrd: perform basic checks on the kernel dir
before calling mkosi
| * 73cad79c9e mkosi-initrd: --kernel-modules-include ->
--kernel-modules
bac76904c3 build(deps): bump github/codeql-action from 3.28.13 to
3.28.16
44161624a2 Supress ssh unit generation if sshd is not present
b8758dac28 Partially revert 640000a861e9cd9a3807e4158e110a098c74d078
6f11937dc6 Don't use default value if optional settings are set to
none
640000a861 Use a default tools tree by default if mkosi.tools.conf
exists
63d91cc285 mkosi: Override misconfigured gitconfig HTTP/HTTPS proxy
with ProxyUrl
a859b5eb13 Make sure we create the default workspace directory as well

5 months agotest: fix test_qdisc_tbf regex with iproute2 v6.15
Luca Boccassi [Tue, 27 May 2025 13:56:32 +0000 (14:56 +0100)] 
test: fix test_qdisc_tbf regex with iproute2 v6.15

iproute2 v6.15 fixed some rounding errors in the reported stats:

https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=d947f365602b30657d1b797e7464000d0ab88d5a

so the current regex doesn't work anymore. Fix it to check for both
old and new values.

systemd-networkd-tests.py[523]: FAIL: test_qdisc_tbf (__main__.NetworkdTCTests.test_qdisc_tbf)
systemd-networkd-tests.py[523]: ----------------------------------------------------------------------
systemd-networkd-tests.py[523]: Traceback (most recent call last):
systemd-networkd-tests.py[523]:   File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5402, in test_qdisc_tbf
systemd-networkd-tests.py[523]:     self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms')
systemd-networkd-tests.py[523]:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
systemd-networkd-tests.py[523]: AssertionError: Regex didn't match: 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms' not found in 'qdisc tbf 35: root refcnt 2 rate 1Gbit burst 5000b peakrate 100Gbit minburst 999200b lat 70ms \nqdisc pfifo 37: parent 35: limit 100000p'

5 months agobpf-program: check if a trivial BPF program can be created and loaded
Yu Watanabe [Fri, 23 May 2025 17:38:46 +0000 (02:38 +0900)] 
bpf-program: check if a trivial BPF program can be created and loaded

Re-introduce the check dropped by
ec3c5cfac74e8361a3b0153cc9e8cfdbbcbde0c6,
ad446c8ceb97c03971f06fd43e97720afe33be5a.

For some reasons, if we are running on LXC, even if bpf_program_supported()
returned true, but bpf_program_load_kernel() failed:
```
Attaching device control BPF program to cgroup /system.slice/test-bpf-devices-875b406d56ac7bc3.scope/186c411f6e991777 failed: Operation not permitted
src/test/test-bpf-devices.c:31: Assertion failed: Expected "r" to succeed, but got error: Operation not permitted
```

5 months agoin-addr-util: use s6_addr* macros everywhere
Jan Vaclav [Tue, 27 May 2025 07:55:50 +0000 (09:55 +0200)] 
in-addr-util: use s6_addr* macros everywhere

Currently, the code in in-addr-util.c uses a mix of accessing the
in6_u members directly, as well as using the s6_addr* macros.
Let's unify it so that the s6_addr macros are used everwhere.

5 months agocgroup-util: assert on attribute for cg_{get,set}_attribute() 37630/head
Mike Yuan [Tue, 27 May 2025 12:25:12 +0000 (14:25 +0200)] 
cgroup-util: assert on attribute for cg_{get,set}_attribute()

It makes zero sense to ever perform IO operations on cgroup dirs.

5 months agocgroup-util: make cg_get_attribute_as_bool() return 0/1 directly
Mike Yuan [Tue, 27 May 2025 12:19:41 +0000 (14:19 +0200)] 
cgroup-util: make cg_get_attribute_as_bool() return 0/1 directly

As with getenv_bool() and getxattr_at_bool(), to match
our usual style.

5 months agocgroup-util: rename cg_get_xattr_malloc -> cg_get_xattr
Mike Yuan [Tue, 27 May 2025 12:15:11 +0000 (14:15 +0200)] 
cgroup-util: rename cg_get_xattr_malloc -> cg_get_xattr

This is not a trivial wrapper around user-created-buffer-based
syscall, so do not use _malloc suffix. Most of our functions
return an internally allocated buffer and this one's not special.

5 months agobasic,shared: mark eligible functions with _pure_/_const_ (#37623)
Daan De Meyer [Tue, 27 May 2025 12:24:30 +0000 (14:24 +0200)] 
basic,shared: mark eligible functions with _pure_/_const_ (#37623)

5 months agorepart: Copy fs-verity status for CopyFiles= (#35401)
Zbigniew Jędrzejewski-Szmek [Tue, 27 May 2025 12:01:05 +0000 (14:01 +0200)] 
repart: Copy fs-verity status for CopyFiles= (#35401)

When populating a filesytem with CopyFiles=, we first copy the files to
a temporary directory. Make sure we use the (new) COPY_FS_VERITY flag
when doing that copy so that the `mkfs` that we invoke can see the files
with fs-verity enabled.

Closes #35352

5 months agocore: introduce io.systemd.Unit.List (first PR) (#37432)
Daan De Meyer [Tue, 27 May 2025 10:42:11 +0000 (12:42 +0200)] 
core: introduce io.systemd.Unit.List (first PR) (#37432)

5 months agomountfsd: add ability to create dir owned by foreign UID range in unpriv $HOME (...
Lennart Poettering [Tue, 27 May 2025 10:20:05 +0000 (12:20 +0200)] 
mountfsd: add ability to create dir owned by foreign UID range in unpriv $HOME (#37616)

5 months agoAssorted systemd-machined fixes (#37622)
Lennart Poettering [Tue, 27 May 2025 10:19:46 +0000 (12:19 +0200)] 
Assorted systemd-machined fixes (#37622)

5 months agoci: add test case for io.systemd.MountFileSystem.MakeDirectory() and varlinkctl ... 37616/head
Lennart Poettering [Mon, 26 May 2025 11:46:21 +0000 (13:46 +0200)] 
ci: add test case for io.systemd.MountFileSystem.MakeDirectory() and varlinkctl --push-fd=

5 months agovarlinkctl: optionally push fds to server
Lennart Poettering [Mon, 26 May 2025 11:19:14 +0000 (13:19 +0200)] 
varlinkctl: optionally push fds to server

5 months agomountfsd: add call for creating a foreign UID owned dir in dir owned by caller
Lennart Poettering [Mon, 26 May 2025 10:16:43 +0000 (12:16 +0200)] 
mountfsd: add call for creating a foreign UID owned dir in dir owned by caller

In order to fully support unpriv containers placed in directories owned
by the foreign UID range, below some unpriv user $HOME, we need to away
to actually create these hierarchies in the first place.

Let's add a method call for that. It takes a dir fd, then validates that
its ownership matches the client's identity, and then creates a subdir,
chown()ing it to the foreign UID range. It then returns an fd to the
result.

The result could then be passed to MountDirectory() in order to get a
mount which can then be populated by some code running in a dynamic
userns.

5 months agosd-json: add json_dispatch_const_filename()
Lennart Poettering [Mon, 26 May 2025 10:15:27 +0000 (12:15 +0200)] 
sd-json: add json_dispatch_const_filename()

json_dispatch_const_filename() is to json_dispatch_filename() what json_dispatch_const_path() is to json_dispatch_path().

5 months agomachine: fix log message, doesn't have to be scope unit, can by any 37622/head
Lennart Poettering [Mon, 19 May 2025 11:26:07 +0000 (13:26 +0200)] 
machine: fix log message, doesn't have to be scope unit, can by any

5 months agomachine: rework machine_gc()
Lennart Poettering [Mon, 19 May 2025 11:24:14 +0000 (13:24 +0200)] 
machine: rework machine_gc()

Let's check the leader alive state, and let's log about dbus errors.
This mimics (but is not quite identical to) what we do these days in
logind for GC'ing user sessions.

5 months agomachine: shorten code
Lennart Poettering [Mon, 19 May 2025 09:12:35 +0000 (11:12 +0200)] 
machine: shorten code

5 months agomachine: as safety precaution also check parsed machine name
Lennart Poettering [Mon, 19 May 2025 09:12:14 +0000 (11:12 +0200)] 
machine: as safety precaution also check parsed machine name

5 months agomachine: also save/restore vsock CID properly
Lennart Poettering [Mon, 19 May 2025 09:19:33 +0000 (11:19 +0200)] 
machine: also save/restore vsock CID properly

5 months agomachine: modernizations of serializing/deserializing netif data
Lennart Poettering [Mon, 19 May 2025 09:19:17 +0000 (11:19 +0200)] 
machine: modernizations of serializing/deserializing netif data

5 months agomachine: save/restore machine leader pidfdid
Lennart Poettering [Mon, 19 May 2025 09:08:52 +0000 (11:08 +0200)] 
machine: save/restore machine leader pidfdid

5 months agomachine: use the correct escaping calls for machine metadata
Lennart Poettering [Mon, 19 May 2025 09:07:53 +0000 (11:07 +0200)] 
machine: use the correct escaping calls for machine metadata

5 months agomachine: properly remove unit name symlink on removal
Lennart Poettering [Mon, 19 May 2025 09:05:51 +0000 (11:05 +0200)] 
machine: properly remove unit name symlink on removal

5 months agomachine: port machined state files to fopen_tmpfile_linkable()
Lennart Poettering [Mon, 19 May 2025 08:58:16 +0000 (10:58 +0200)] 
machine: port machined state files to fopen_tmpfile_linkable()

Similar to the erlier commit for logind, switch to a more modern way to
write the state files.

5 months agomachine: insist in a valid root directory
Lennart Poettering [Thu, 15 May 2025 10:25:47 +0000 (12:25 +0200)] 
machine: insist in a valid root directory

5 months agologind,machined: expose bus properties for leader PID fd ids, too
Lennart Poettering [Mon, 19 May 2025 15:57:08 +0000 (17:57 +0200)] 
logind,machined: expose bus properties for leader PID fd ids, too

5 months agocore: break line after sd_json_buildo( in varlink-manager.c 37432/head
Ivan Kruglov [Mon, 26 May 2025 14:56:29 +0000 (07:56 -0700)] 
core: break line after sd_json_buildo( in varlink-manager.c

5 months agotest: simple tests for io.systemd.Unit varlink interface
Ivan Kruglov [Mon, 26 May 2025 10:14:28 +0000 (03:14 -0700)] 
test: simple tests for io.systemd.Unit varlink interface

5 months agotest: quote entire path to socket in io.systemd.Manager tests
Ivan Kruglov [Mon, 26 May 2025 10:13:55 +0000 (03:13 -0700)] 
test: quote entire path to socket in io.systemd.Manager tests

5 months agocore: add basic lookup by name/pidref in io.systemd.Unit.List
Ivan Kruglov [Thu, 15 May 2025 10:04:28 +0000 (03:04 -0700)] 
core: add basic lookup by name/pidref in io.systemd.Unit.List

5 months agojson: add unit tests for json_dispatch_const_unit_name()
Ivan Kruglov [Mon, 26 May 2025 10:02:59 +0000 (03:02 -0700)] 
json: add unit tests for json_dispatch_const_unit_name()

5 months agojson: json_dispatch_const_unit_name()
Ivan Kruglov [Fri, 23 May 2025 13:57:02 +0000 (06:57 -0700)] 
json: json_dispatch_const_unit_name()

5 months agocore: Unit Runtime in io.systemd.Unit.List method
Ivan Kruglov [Tue, 13 May 2025 18:40:49 +0000 (11:40 -0700)] 
core: Unit Runtime in io.systemd.Unit.List method

5 months agocore: skeleton for io.system.Unit interface and io.systemd.Unit.List method
Ivan Kruglov [Fri, 15 Nov 2024 08:50:28 +0000 (09:50 +0100)] 
core: skeleton for io.system.Unit interface and io.systemd.Unit.List method

5 months agorepart: add 'fsverity' flag for CopyFiles= lines 35401/head
Allison Karlitskaya [Mon, 2 Dec 2024 09:50:02 +0000 (10:50 +0100)] 
repart: add 'fsverity' flag for CopyFiles= lines

We currently pass the CopyFlags that we use to populate the temporary
directory in the form of a constant at each of the copy_tree_at() call
sites.  De-duplicate that and move it into the `CopyFilesLine` struct,
initializing it from the parser.

Add our first non-constant flag: `fsverity=`.  This can be set to `off`
(the default) or `copy`, in which case we copy the fs-verity state from
the source files.

This arrangement is amenable to the introduction of more flags to
`CopyFiles=` lines, if we want to add them in the future.

Update the `repart.d(5)` manpage.

Closes #35352

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agorepart: Collect CopyFiles= lines into structs
Allison Karlitskaya [Mon, 2 Dec 2024 09:46:46 +0000 (10:46 +0100)] 
repart: Collect CopyFiles= lines into structs

We currently convert the source:target pairs of the `CopyFiles=` lines
in `repart.d` files into a pairwise strv.  This works great if the only
thing that can be specified is a source and a target, but we're about to
add a flags field.

Let's start by making this a bit more explicit: we now turn each
`CopyFiles=` line into a `CopyFilesLine` struct.  We keep an array of
those in the `Partition` now, instead of the strv.

So far this is a whole lot of added complexity for nothing, but it's
necessary for the next step.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agomkfs-util: add fsverity option to make_filesystem()
Allison Karlitskaya [Mon, 2 Dec 2024 20:00:47 +0000 (21:00 +0100)] 
mkfs-util: add fsverity option to make_filesystem()

Add an fsverity flag to MkfsFlags and use it to pass the `-O verity`
option when creating an ext4 or f2fs filesystem: they share the same
argument for this.

The only other filesystem that currently supports fs-verity is btrfs and
it doesn't require a flag to be enabled when creating the filesystem.

Nothing uses this yet.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agomkfs-util: turn quiet/discard to a flags field
Allison Karlitskaya [Tue, 3 Dec 2024 08:21:16 +0000 (09:21 +0100)] 
mkfs-util: turn quiet/discard to a flags field

Add a new `MakeFilesystemFlags` enum and use it to replace the existing
`quiet` and `discard` booleans on `make_filesystem()`.

Update the callers.  While we're doing that, consolidate some duplicated
logic in systemd-repart.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agomkfs-util: rename a local variable
Allison Karlitskaya [Wed, 19 Mar 2025 14:44:51 +0000 (15:44 +0100)] 
mkfs-util: rename a local variable

Change 'flags' to 'fork_flags' in preparation for using 'flags' as an
argument in the next commit.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agotest: add a testcase for copy_tree() and fs-verity
Allison Karlitskaya [Mon, 26 May 2025 11:02:33 +0000 (13:02 +0200)] 
test: add a testcase for copy_tree() and fs-verity

5 months agocopy: add support for copying fs-verity status
Allison Karlitskaya [Thu, 28 Nov 2024 13:06:34 +0000 (14:06 +0100)] 
copy: add support for copying fs-verity status

Add a new member to CopyFlags to request copying of fs-verity status.

If copying of fs-verity is requested then we query the descriptor from
each regular file.  If it has one, we use it to setup fs-verity on the
destination, using the same parameters.

Signatures don't seem to be a particularly well-loved (or used) feature
of fs-verity and we don't bother to query them here.  Support for that
could be added later, if desired.

This change means that, with the correct combination of flags, we might
end up calling `fsync()` on a read-only file descriptor.  This is
permitted by POSIX and supported on Linux.

Nothing uses this yet.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
5 months agofs-util: prefer linkat(AT_EMPTY_PATH) over /proc/self/fd/ shenanigans
Mike Yuan [Tue, 27 May 2025 00:10:07 +0000 (02:10 +0200)] 
fs-util: prefer linkat(AT_EMPTY_PATH) over /proc/self/fd/ shenanigans

The permission check got relaxed in kernel v6.10, so let's
switch the fallback order around.

This also effectively reverts 94d94f0c0a7d28816c815dc9770cc659769fe980,
as I just realized that link_fd() involves multiple paths and
we can't tell which one tripped ENOENT...

5 months agocgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated...
Yu Watanabe [Tue, 27 May 2025 01:41:56 +0000 (10:41 +0900)] 
cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated field (#37624)

5 months agohomed: generate proper error if we cannot create mountpoint for homedir
Lennart Poettering [Fri, 23 May 2025 10:15:45 +0000 (12:15 +0200)] 
homed: generate proper error if we cannot create mountpoint for homedir

Let's make this easier to debug. (When this failed for me due to disk
full it took me a bit to figure out what was going on.)

5 months agoudevadm-info: update error messages (#37619)
Yu Watanabe [Tue, 27 May 2025 01:08:24 +0000 (10:08 +0900)] 
udevadm-info: update error messages (#37619)

5 months agocgroup-util: remove now unused cg_read_event() 37624/head
Mike Yuan [Mon, 26 May 2025 20:32:12 +0000 (22:32 +0200)] 
cgroup-util: remove now unused cg_read_event()

cg_get_keyed_attribute() is a more generic version of this,
and cg_is_empty_recursive() was the only user of this function,
which got converted in the previous commit.

5 months agocgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated...
Mike Yuan [Mon, 26 May 2025 20:27:26 +0000 (22:27 +0200)] 
cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated field

This effectively renames cg_is_empty_recursive() to cg_is_empty().
Note that all existing code calls the former and not the latter,
hence with cgv1 support being dropped it's trivial to consult
cgroup.events directly for populated state everywhere.

Additionally, use more generic cg_get_keyed_attribute() helper
rather than cg_read_event().

5 months agosrc/core/manager.c: log preset activity on first boot
Dusty Mabe [Fri, 23 May 2025 13:18:12 +0000 (09:18 -0400)] 
src/core/manager.c: log preset activity on first boot

This gives us a little more information about what units were enabled
or disabled on that first boot and will be useful for OS developers
tracking down the source of unit state.

An example with this enabled looks like:

```
NET: Registered PF_VSOCK protocol family
systemd[1]: Applying preset policy.
systemd[1]: Unit /etc/systemd/system/dnsmasq.service is masked, ignoring.
systemd[1]: Unit /etc/systemd/system/systemd-repart.service is masked, ignoring.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir.mount' → '/etc/systemd/system/var-mnt-workdir.mount'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir\x2dtmp.mount' → '/etc/systemd/system/var-mnt-workdir\x2dtmp.mount'.
systemd[1]: Created symlink '/etc/systemd/system/afterburn-sshkeys.target.requires/afterburn-sshkeys@core.service' → '/usr/lib/systemd/system/afterburn-sshkeys@.service'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket' → '/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket' → '/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
systemd[1]: Populated /etc with preset unit settings.
```

Considering it only happens on first boot and not on every boot I think
the extra information is worth the extra verbosity in the logs just for
that boot.

5 months agopolkit: reword 'Interactive authentication required' error
Lennart Poettering [Fri, 23 May 2025 20:05:15 +0000 (22:05 +0200)] 
polkit: reword 'Interactive authentication required' error

I guess the current wording of "Interactive authentication required." is
hard to grok for many users. Let's try to reword this, and say
explicitly:

1. That this is a form of "access denied" error
2. That interactive auth could remedy this
3. But that the client disabled interactive auth

I think these are the three primary elements the error msg needs to
convey. I tried to distill this in a short error string with this.

Fixes: #2081
5 months agocore/cgroup: CGRuntime.cgroup_path indicates whether the cg is still alive
Mike Yuan [Mon, 26 May 2025 20:46:17 +0000 (22:46 +0200)] 
core/cgroup: CGRuntime.cgroup_path indicates whether the cg is still alive

so drop redundant checks in attr getters. Memory and IO accounting
functions already follow this pattern.

5 months agovarlinkctl: if returned error is an errno, print it as one in log message
Lennart Poettering [Mon, 26 May 2025 11:19:43 +0000 (13:19 +0200)] 
varlinkctl: if returned error is an errno, print it as one in log message

5 months agohwdb: make Saitek PLC Pro Flight Rudder Pedals a joystick (#37601)
tuxmainy [Mon, 26 May 2025 20:50:04 +0000 (20:50 +0000)] 
hwdb: make Saitek PLC Pro Flight Rudder Pedals a joystick (#37601)

Fuzzy logic on joystick vs. advanced keyboard detection thinks the
rudders are a keyboard. Adding this forces udev to use this device as
joystick.

```
# udevadm info /dev/input/by-id/usb-Saitek_Saitek_Pro_Flight_Rudder_Pedals-event-joystick
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:06A3:0763.000D/input/input22/event3
M: event3
R: 3
U: input
D: c 13:67
N: input/event3
L: 0
S: input/by-id/usb-Saitek_Saitek_Pro_Flight_Rudder_Pedals-event-joystick
S: input/by-path/pci-0000:00:14.0-usbv2-0:3:1.0-event-joystick
S: input/by-path/pci-0000:00:14.0-usb-0:3:1.0-event-joystick
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:06A3:0763.000D/input/input22/event3
E: DEVNAME=/dev/input/event3
E: MAJOR=13
E: MINOR=67
E: SUBSYSTEM=input
E: USEC_INITIALIZED=10981053700
E: ID_INPUT=1
E: ID_INPUT_JOYSTICK=1
E: ID_BUS=usb
E: ID_MODEL=Saitek_Pro_Flight_Rudder_Pedals
E: ID_MODEL_ENC=Saitek\x20Pro\x20Flight\x20Rudder\x20Pedals
E: ID_MODEL_ID=0763
E: ID_SERIAL=Saitek_Saitek_Pro_Flight_Rudder_Pedals
E: ID_VENDOR=Saitek
E: ID_VENDOR_ENC=Saitek
E: ID_VENDOR_ID=06a3
E: ID_REVISION=0101
E: ID_TYPE=hid
E: ID_USB_MODEL=Saitek_Pro_Flight_Rudder_Pedals
E: ID_USB_MODEL_ENC=Saitek\x20Pro\x20Flight\x20Rudder\x20Pedals
E: ID_USB_MODEL_ID=0763
E: ID_USB_SERIAL=Saitek_Saitek_Pro_Flight_Rudder_Pedals
E: ID_USB_VENDOR=Saitek
E: ID_USB_VENDOR_ENC=Saitek
E: ID_USB_VENDOR_ID=06a3
E: ID_USB_REVISION=0101
E: ID_USB_TYPE=hid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv2-0:3:1.0
E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0
E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_3_1_0
E: LIBINPUT_DEVICE_GROUP=3/6a3/763:usb-0000:00:14.0-3
E: DEVLINKS=/dev/input/by-id/usb-Saitek_Saitek_Pro_Flight_Rudder_Pedals-event-joystick /dev/input/by-path/pci-0000:00:14.0-usbv2-0:3:1.0-event-joystick /dev/input/by-path/pci-0000:00:14.>
E: TAGS=:seat:uaccess:
E: CURRENT_TAGS=:seat:uaccess:
```

```
# lsusb |fgrep Sait
Bus 001 Device 013: ID 06a3:0763 Saitek PLC Pro Flight Rudder Pedals
```

Closes #34642.

5 months agotree-wide: Handle EINVAL as not supported for chattr_xxx()
Daan De Meyer [Mon, 26 May 2025 14:11:06 +0000 (16:11 +0200)] 
tree-wide: Handle EINVAL as not supported for chattr_xxx()

F2FS returns EINVAL from FS_IOC_SETFLAGS when trying to set
FS_NOCOW_FL. Let's handle this by treating EINVAL as not supported.
While we're at it, make sure we use ERRNO_IS_IOCTL_NOT_SUPPORTED()
across the tree instead of ERRNO_IS_NOT_SUPPORTED() when calling any
of the chattr_xxx() functions.

Fixes #37593

5 months agosocket-util: Move getsockopt_int() to implementation file
Daan De Meyer [Mon, 26 May 2025 14:20:16 +0000 (16:20 +0200)] 
socket-util: Move getsockopt_int() to implementation file

And switch back to negative_errno() at the same time.

5 months agosd-bus: mark two functions as pure 37623/head
Mike Yuan [Mon, 26 May 2025 18:37:48 +0000 (20:37 +0200)] 
sd-bus: mark two functions as pure

5 months agobasic,shared: mark eligible functions with _pure_/_const_
Mike Yuan [Mon, 26 May 2025 18:04:54 +0000 (20:04 +0200)] 
basic,shared: mark eligible functions with _pure_/_const_

Following the recent witch hunt done to static inline functions
I figure we should at least give the compiler some more hint
on optimizations.

5 months agoshared/bitmap: minor modernizations
Mike Yuan [Mon, 26 May 2025 18:01:17 +0000 (20:01 +0200)] 
shared/bitmap: minor modernizations

5 months agoerrno-list: errno_from_name() is pure but not const
Mike Yuan [Mon, 26 May 2025 18:19:59 +0000 (20:19 +0200)] 
errno-list: errno_from_name() is pure but not const

Follow-up for 0c15577abe013e07dba47d5aac126a63ab2dfd33

5 months agofd-util: group close_fd_ptr() with fd funcs, not FILE/DIR stream ones
Mike Yuan [Mon, 26 May 2025 17:24:10 +0000 (19:24 +0200)] 
fd-util: group close_fd_ptr() with fd funcs, not FILE/DIR stream ones