Commit Graph
84252 Commits
Author SHA1 Message Date
Frantisek Sumsal 3b4b3b8a95 Revert "Update systemctl.xml"
This reverts commit b0fe317d14.
This reverts commit 9f4f7f0372.
2025-10-23 15:42:28 +02:00
Frantisek Sumsal 7168535165 man: handle leading/trailing/repeating whitespaces in anchor links
So even if a <term> section contains newlines, we get a reasonable
anchor link to it.

Before:
<dt id="
  bind
  UNIT
  PATH
  [PATH]
"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20[PATH]%0A%20%20%20%20%20%20%20%20%20%20">¶</a>

After:
<dt id="bind UNIT PATH [PATH]"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#bind%20UNIT%20PATH%20[PATH]">¶</a>

Resolves: #39196
2025-10-23 15:42:28 +02:00
Frantisek Sumsal c05758663b test: properly wait for the forked process
The process forked off by `systemd-notify --fork` is not a child of the
current shell, so using `wait` doesn't work. This then later causes a
race, when the test occasionally fails because it attempts to start a
new systemd-socket-activate instance before the old one is completely
gone:

[ 1488.947744] TEST-74-AUX-UTILS.sh[1938]: Child 1947 died with code 0
[ 1488.947952] TEST-74-AUX-UTILS.sh[1933]: + assert_eq hello hello
[ 1488.949716] TEST-74-AUX-UTILS.sh[1948]: + set +ex
[ 1488.950112] TEST-74-AUX-UTILS.sh[1950]: ++ cat /proc/1938/comm
[ 1488.945555] systemd[1]: Started systemd-networkd.service - Network Management.
[ 1488.950365] TEST-74-AUX-UTILS.sh[1933]: + assert_in systemd-socket systemd-socket-
[ 1488.950563] TEST-74-AUX-UTILS.sh[1951]: + set +ex
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + kill 1938
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + wait 1938
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: .//usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh: line 14: wait: pid 1938 is not a child of this shell
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + :
[ 1488.951486] TEST-74-AUX-UTILS.sh[1952]: ++ systemd-notify --fork -- systemd-socket-activate -l 1234 --now socat ACCEPT-FD:3 PIPE
[ 1488.952222] TEST-74-AUX-UTILS.sh[1953]: Failed to listen on [::]🔢 Address already in use
[ 1488.952222] TEST-74-AUX-UTILS.sh[1953]: Failed to open '1234': Address already in use
[ 1488.956831] TEST-74-AUX-UTILS.sh[1933]: + PID=1953
[ 1488.957078] TEST-74-AUX-UTILS.sh[102]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh failed'
[ 1488.957078] TEST-74-AUX-UTILS.sh[102]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh failed
2025-10-23 11:56:26 +01:00
Yu Watanabe cc7ccd3c6a man/network: extend document about the default value of IPv6AcceptRA=
Prompted by #39304.
2025-10-23 11:13:36 +09:00
Yu Watanabe a5962d3327 rereadpt: always update kernel partition tables from userspace in an incremental fashion (#39390)
Let's address #38672 comprehensively: let's avoid BLKRRPART as much as
we can, and always do careful userspace controlled, incremental updates
to the kernel partition tables.

This simply iterates through blkid's partition parsing, and turns it
into a BLKPG ioctls, adding, updating, removing partitions as necessary,
suppressing unnecessary changes. This has the major benefit that the
call becomes truly idempotent: if nothing changed then nothing is
removed/readed, like BLKRRPART is doing it.

This then ports over all code currently doing partition refreshing,
specifcially: udev, repart, and homed.

Fixes: #38672
2025-10-23 09:35:03 +09:00
Yu Watanabe 80297f75e1 Two minor id128-related cleanups (#39407)
Split out from #39210
2025-10-23 09:30:11 +09:00
Lennart Poettering e582484789 tree-wide: open block device locks in writable mode
udev's block device locking protocol has one pitfall not even the
example in the documentation got right so far (even though this is
explained in all detail above): udev's rescanning is only triggered when
an fd that is opened for writing is closed. This means that if a
separate locking fd is opened on a block device – one that is maintained
independently of the fd actually used for writing – it must be opened for
writing too, so that closing the lock definitely triggers a rescan. This
matters in cases where the lock fd is kept for longer than the fd used
for writing to disk. (Because otherwise udev might get the
IN_CLOSE_WRITE event, but when it tries to rescan will find the device
locked, and never retry because no IN_CLOSE_WRITE is triggred anymore.)

Let's fix that across the codebase, at 4 places:

1. in makefs (a lock fd is kept, and mkfs then invoked as child, which
   uses a different fd, and the lock fd is closed only once the child
   died)

2. in udevadm lock (embarassing!): which is intended to be used to wrap tools
   that modify disk contents, very similar to the makefs case. The lock
   is also kept until after the tool exited.

3. In storagetm: the kernel nvme-tcp layer writes to the device
   directly, we just keep a lock fd.

4. the example in BLOCK_DEVICE_LOCKING.md
2025-10-22 22:56:02 +02:00
Lennart Poettering 46da450f13 repart: switch things over to our own partition reread logic 2025-10-22 22:56:02 +02:00
Lennart Poettering 78c017a8ed repart: split out that disarms automatic artifact removal 2025-10-22 22:56:01 +02:00
Lennart Poettering aa47d8ade1 udev: switch over to rereadpt() rather than raw BLKRRPART
Fixes: #38672
2025-10-22 22:56:01 +02:00
Lennart Poettering 0ef4118c78 homed: switch from raw BLKRRPART to rereadpt_fd() 2025-10-22 22:56:01 +02:00
Lennart Poettering 757887d01d rereadpt: implement userspace-based BLKRRPART re-implementation 2025-10-22 22:56:01 +02:00
Lennart Poettering 524ebfe28a blockdev-util: split out partition device node generation from dissect-util.c 2025-10-22 22:56:01 +02:00
Lennart Poettering bb45a893c2 blockdev-util: in blockdev_partscan_enabled() check if we are operating on block device first
The function makes no sense on any other type of fd, hence we better
check this explicitly.
2025-10-22 22:56:01 +02:00
Lennart Poettering a251345cf5 blockdev-util: rename BlockDeviceLookupFlag to plural
This is a flags type and a flag function argument, let's name it in
plural, because it allows many flags combinations. Internally, the
implementation already used plural, but let's fix the prototypes too.
2025-10-22 22:56:01 +02:00
Lennart Poettering b09ea23978 sd-device: add device_get_property_uint() helper
This is just like device_get_property_int() but operates on unsigned
ints.
2025-10-22 22:56:01 +02:00
Luca Boccassi d62ab43fd0 mkosi: update debian commit reference to 5650452e6b0b430f44d3d48b7322c2b3c8b9477f
* 5650452e6b Install new files for upstream build
* 607afcd060 salsa: disable arm64/ppc64el again
* b1bb6d4849 systemd-tests: drop unused overrides
* b3790a36ca getty-static: add missing Documentation=
* 1cea27caba Backport patch to fix autopkgtest with new util-linux due to file move
* 2e74a7f969 Update changelog for 258.1-1 release
* 9250e242b9 Make /run/lock world writable by default
2025-10-22 20:06:44 +02:00
Daan De Meyer ed5b77fe2e vmspawn: Add --bind-user= and --bind-user-shell= (#38410)
We use virtiofsd ID translation to mimick idmapped mounts and the
transient userdb credentials to provision the mapped user in the VM.
2025-10-22 20:03:47 +02:00
DaanDeMeyer b1681f981b vmspawn: Add --bind-user= and --bind-user-shell=
We use virtiofsd ID translation to mimick idmapped mounts and the
transient userdb credentials to provision the mapped user in the VM.
2025-10-22 16:42:50 +02:00
Daan De Meyer ac0a248ee6 vmspawn: Use machine_credential_add() 2025-10-22 16:42:50 +02:00
DaanDeMeyer af0ae29714 machine-bind-user: Make home mount directory configurable 2025-10-22 16:42:50 +02:00
DaanDeMeyer 9aa6c30bbd machine-bind-user: Use machine in log messages instead of container 2025-10-22 16:42:50 +02:00
Daan De Meyer 64d5bb4d53 nspawn: Add --bind-user-shell= to --help 2025-10-22 16:42:46 +02:00
theSillywhat 3331d99b49 Missing policies for polkit as mentioned in freedesktop.org/software/systemd/man 2025-10-22 16:20:44 +02:00
Zbigniew Jędrzejewski-Szmek e39cde9585 Disable abort in log_assert in libsystemd/libudev (#39307)
See the second commit for details.

I think we might want to apply the same treatment to nss and pam
modules. Asserting in such "plugin code" seems iffy. But this PR doesn't
change those in any way.
2025-10-22 14:48:14 +02:00
Mike Yuan 7d4e8f920b shared/bus-get-properties: use sizeof instead of hardcoded size in bus_property_get_id128()
Prompted by
https://github.com/systemd/systemd/pull/39210#discussion_r2404225907
2025-10-22 14:44:50 +02:00
Mike Yuan fbc9f0dd4e libsystemd-network/sd-lldp-tx: use SD_JSON_BUILD_PAIR_ID128 2025-10-22 14:44:50 +02:00
Lennart Poettering b38dc56bab coredump: split coredump.c into small pieces (#39351) 2025-10-22 13:37:51 +02:00
Lennart Poettering aea2f059a3 tree-wide: use setenvf() more, where appropriate 2025-10-22 13:36:18 +02:00
Daan De Meyer 8e4f26a23b import: support in --user mode (#39322)
This is the first half of #38728, just the parts that immediately touch
importd to add a --user mode for it.
2025-10-22 12:59:46 +02:00
Ryan Brue e80c5eb6e6 man: Clarify usage of /usr/share/factory/ in programs
As discussed in this thread:
https://github.com/redhat-performance/tuned/issues/798#issuecomment-3197697654

/usr/share/factory/ is not intended to be read from by programs,
but the wording in the FHS can be misread to think that programs
should be using /usr/share/factory/ as the vendor supplied configuration
directory rather than something like /usr/lib/foo/ or /usr/share/foo/.

This commit points developers to the UAPI configuration spec for how to
make their programs hermetic /usr/ compatible.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-10-22 11:07:23 +02:00
Zbigniew Jędrzejewski-Szmek 0bb0316f5e Do not use "critical assert_return" in libsystemd or libudev
Previously, when compiled in developer mode, a call into libsystemd with
invalid parameters would result in an abort. This means that it's effectively
impossible to install such libsystemd in a normal system, since various
third-party programs may now abort. A shared library should generally never
abort or exit the calling program.

In python-systemd, the test suite calls into libsystemd, to check if the proper
return values are received and propagated through the Python wrappers.
Obviously with libsystemd compiled from git, the test suite now fails
in a nasty way.

So rework the code to set assert_return_is_critical similarly to how we handle
mempool enablement: the function that returns true is declared as a week
symbol, and we "opt in" by linking a file that provides the function in
libsystemd-shared. Effectively, libsystemd and libudev always have
assert_return_is_critical==false, and our binaries and modules enable it
conditionally.
2025-10-22 10:10:24 +02:00
Zbigniew Jędrzejewski-Szmek 882dfbde1c basic/mempool: mark mempool_enabled as _pure_
The function internally does caching which means that the result must
always be the same, the definition of a pure function. The compiler might
be able to optimize some repeated calls to the function.
2025-10-22 10:06:07 +02:00
Daniel Foster c7a444a9c1 tree-wide: extend $LISTEN_FDS protocol with $LISTEN_PIDFDID
Although extremely unlikely, there is a race present in solely checking the
$LISTEN_PID environment variable, due to PID recycling. Fix that by introducing
$LISTEN_PIDFDID, which contains the 64-bit ID of a pidfd for the child process
that is not subject to recycling.
2025-10-22 09:34:14 +02:00
Septatrix 93b6d43253 Remove dns0.eu from default DNS servers
The service has ceased operation.
Partially reverts 02527e95b5.
2025-10-22 01:39:41 +02:00
Lennart Poettering 25dbf586b2 importd: downgrade log message about bound capability set dropping + netns
An unprivileged process cannot reduce its own capability bounding set,
hence, while it is nice to reduce the set, let's not log about it
loudly, in case we are invoked unpriv (which we explicity support these
days after all).

An unpriv process also cannot detach from its netns, hence also
downgrade the warning to a debug message.
2025-10-21 23:09:50 +02:00
Lennart Poettering 1be8caa6be importd: support unpacking tarballs to foreign UID range
When invoked unprivileged, let's use a transiently allocated userns, so
that we can properly untar UIDs/GIDs so that the trees appear owned by
the foreign UID/GID range.
2025-10-21 23:09:50 +02:00
Lennart Poettering d9c10bf1d2 importd: clean up how we determine image root in importd backends
Let's introduce a single helper that determines where to download images
to, taking all three primary parameters into account: the image class,
the runtime scope and whether to do runtime or persistency.

Then port everything over to this.

This not only cleans things up, but makes sure the importd backends
actually properly can deal with per-user downloads, as before we never
took the runtime scope into account for determining download location.
2025-10-21 23:09:50 +02:00
Lennart Poettering 0960b905bc importctl: add --user/--system switches 2025-10-21 23:09:50 +02:00
Lennart Poettering f7c72e8725 importd: properly support operation in per-user mode 2025-10-21 23:09:50 +02:00
Lennart Poettering b76a76ac15 importd: teach all backends --system/--user mode
The runtime scope logic is internally already in place, let's expose
this via getopt() command line too. This way importd later can propagate
the invocation scope down to the backends.
2025-10-21 23:09:50 +02:00
Lennart Poettering 570366b6e1 install-file: add flags to handle RO and syncing failures graceful
When operating in unprivileged mode we might not be able to execute the
necessary operations to make a disk image read-only (because
FS_IMMUTABEL_FL needs privs for example), and syncing (because for that
we might need to open the root inode, but that might not be possible
from the outside).

Let's deal with that by making these operation optional: if they work
great, if not they don't.
2025-10-21 23:09:50 +02:00
Lennart Poettering 69332065e2 copy: make copy_tree_at_full()'s 'to' parameter optional
Sometimes it's quite useful to pin a source dir via an fd, as well as a
target dir the same way, and then ask copy_tree_at_full() to copy the
contents from one to the other. Make this possible, by allowing 'to' be
NULL. (Previously, it had to be non-NULL, i.e. the function would always
create a new dir, no matter what.)

Note that we only support that for dir inodes.
2025-10-21 23:09:50 +02:00
Lennart Poettering 0a9e2e45f0 copy: optionally apply source inode's stat() when doing a merge copy 2025-10-21 23:09:50 +02:00
Lennart Poettering bcafa70974 nsresource: add constants for the only supported UID range size allocations
As requested: https://github.com/systemd/systemd/pull/39322#discussion_r2447366728
2025-10-21 23:09:50 +02:00
Lennart Poettering b3e5e00d45 dissect-image: explain one more error 2025-10-21 22:02:22 +09:00
Yu Watanabe 02fea5b412 ci/oss-fuzz: switch to Ubuntu 24.04
With
https://github.com/google/oss-fuzz/pull/14112 and
https://github.com/google/oss-fuzz/pull/14128,
we can now use Ubuntu 24.04. Let's bump the image version.

Note, the i386 build failure mentioned in the removed comment is related to
https://bugs.launchpad.net/ubuntu/+source/linux-signed-azure/+bug/2071445
https://github.com/actions/runner-images/issues/9977
and has been already fixed.
2025-10-21 15:09:24 +09:00
Yu Watanabe f88f0271f8 TEST-75-RESOLVED: stop socket units before stopping the main service
Fixes the following warning:
TEST-75-RESOLVED.sh[2251]: ++ restart_resolved
TEST-75-RESOLVED.sh[2251]: ++ systemctl stop systemd-resolved.service
TEST-75-RESOLVED.sh[2271]: Stopping 'systemd-resolved.service', but its triggering units are still active:
TEST-75-RESOLVED.sh[2271]: systemd-resolved-monitor.socket, systemd-resolved-varlink.socket
2025-10-21 15:07:53 +09:00
Hans de Goede b8490c9e51 hwdb: Add V64x_V65xAU to list of Clevo models where scancode f7+f8 get mapped to touchpad-toggle
Fn + F1 which is the shortcut for toggling the touchpad on/off sends
atkbd scancodes f7 (first press) + f8 (second press) just like on various
other Clevo models. Add the V64x_V65xAU model to the list of models where
these scancodes are mapped to touchpad-toggle.
2025-10-21 07:56:02 +09:00
Lennart Poettering b61f2969c2 networkd: minor units to unit file Description= strings (#39386) 2025-10-20 22:14:17 +02:00