Commit Graph
80251 Commits
Author SHA1 Message Date
Yu Watanabe 786f60eb5d man: fix typo
Follow-up for 6fd253753c.
2025-03-21 08:35:36 +09:00
Matteo Croce dcde1e903a match glibc in ConditionVersion
Extend ConditionVersion= to allow matching against glibc version,
as proposed in https://github.com/systemd/systemd/pull/36468#issuecomment-2674600909
2025-03-21 06:57:28 +09:00
Jose Ortuno 966f872880 po: Translated using Weblate (Spanish)
Currently translated at 97.2% (250 of 257 strings)

Co-authored-by: Jose Ortuno <jose_ortuno@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main
2025-03-21 06:46:21 +09:00
Mike Yuan 551d4c91e8 core/meson: libcore doesn't depend on PAM
It's only used by sd-executor.
2025-03-20 21:34:31 +00:00
Lennart Poettering 112a9de6c4 Add --root for systemd-update-done and other small fixups (#36803) 2025-03-20 18:19:17 +01:00
Zbigniew Jędrzejewski-Szmek ace814f0a8 update-done: create /etc and /var if they didn't exist
Previously, we would fail. But this doesn't seem useful: we may want to
mark the update as done even if /etc/ or /var/ no updates were necessary
and there was no need to create /etc/ or /var/ yet.
2025-03-20 15:57:14 +01:00
Zbigniew Jędrzejewski-Szmek 2ff40c758e update-done: add --root= arg
The idea is to use this when building an image to mark the image as not
needing updates after the reboot. In general it is impossible to say if
any of the early boot update services can be safely skipped, except when
the creator of the image knows all the contents there and has made sure
that all the updates have been processed. (This is in fact what happens
in a typical package-based installation: the packages have scriptlets which
implement the changes during or after the installation process.)

With this patch, the image build process can do 'systemd-update-done --root=…'
at the appropriate point to avoid triggering of ldconfig.service,
systemd-hwdb-update.service, etc.

I didn't write --image=, because it doesn't seem immediately useful. The
approach with --root is most useful when we're building the image "offline",
which means that we have a directory we're working on.
2025-03-20 15:57:14 +01:00
Zbigniew Jędrzejewski-Szmek 20f7f0a891 update-done: add basic argument parsing and --help
We certainly want to reject calls with any args specified. Previously
we would just silently ignore any args.
2025-03-20 15:15:48 +01:00
hsu zangmen 0ffd176bf7 po: Translated using Weblate (Chinese (Traditional) (zh_TW))
Currently translated at 88.7% (228 of 257 strings)

Co-authored-by: hsu zangmen <chzang55@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_TW/
Translation: systemd/main
2025-03-20 22:51:41 +09:00
Zbigniew Jędrzejewski-Szmek bca9a6e2be update-done: split out run() 2025-03-20 14:36:20 +01:00
Zbigniew Jędrzejewski-Szmek 04db1a6aec update-done: adjust comments
The man page was right, but the comment in the generated file was wrong. The
timestamp is *not* the timestamp when the update is being done. While at it,
say to what directory the message applies. This makes it easier for a casual
reader to figure out what is happening.

Also rename the function to better reflect what it does.

Inspired by https://github.com/systemd/systemd/issues/36045.
2025-03-20 14:36:20 +01:00
Lennart Poettering 6fd253753c vmspawn: allow TPM state to be persistent + rework runtime dir logic
When using vmspawn on particleos image we really want that the TPM state
is retained between invocation, since the encryption key is locked to
the TPM after all. Hence let's support that.

This adds --tpm-state= which can be used to configure a path to store
the TPM state in. It can also be used to force tpm state to be transient
or to let vmpsawn pick the path automatically.

While we are at it, let's also revamp the runtime dir handling in
vmspawn: let's no longer place the sockets the auxiliary services listen
on within their own runtime directories. Instead, just drop the runtime
directories for them entirely (since neither virtiofsd, nor swtpm
actually use them). Also, let systemd clean up the sockets
automatically.
2025-03-20 14:30:00 +01:00
Erik Larsson 6e529860ba networkd: add support for externally managed vxlan devices
With this a vxlan interface can be created which is managed by
for example a EVPN control plane.
2025-03-20 20:29:47 +09:00
Lennart Poettering 9d37b8f690 namespace: use EBADF where appropriate 2025-03-20 12:26:06 +01:00
Daan De Meyer a0063ac988 packit: Enable use_target_repo_for_fmf_url option (#36794)
Currently this is picked up from the main branch of the fork which is
suboptimal. The packit folks implemented this new option for us which
should fix the problem.
2025-03-20 09:24:41 +01:00
Daan De Meyer 314ea2ec7b fmf: Use mkosi -f together with ToolsTreePackageDirectories=
There's no need to build various systemd tools from source again to
build the mkosi image when we can just install the packages that were
already built from source into the tools tree so let's do that to avoid
unnecessary compiling.
2025-03-20 09:24:07 +01:00
Daan De Meyer f5cf72b566 fmf: Drop -f from subsequent mkosi sandbox calls
Only required for the first call to mkosi sandbox, after that we can
assume the tools tree has already been built.
2025-03-20 09:24:07 +01:00
Daan De Meyer 1f3bf2a9a2 fmf: Allow overriding the mkosi distribution and release used 2025-03-20 09:24:07 +01:00
Daan De Meyer a3b8fee46e fmf: Download rpms manually instead of going via repositories
This both makes the script more independent, and allows us to add support
for CBS (CentOS Community Build System) at the same time.
2025-03-20 09:24:03 +01:00
Yu Watanabe db4b4e0cd3 core: Make DelegateNamespaces= work for user managers with CAP_SYS_ADMIN (#36771)
Currently DelegateNamespaces= only works for services spawned by the
system manager. User managers will always unshare the user namespace
first even if they're running with CAP_SYS_ADMIN.

Let's add support for DelegateNamespaces= for user managers if they're
running with CAP_SYS_ADMIN. By default, we'll still delegate all
namespaces
for user managers, but this can now be overridden by explicitly passing
DelegateNamespaces=.

If a user manager is running without CAP_SYS_ADMIN, the user manager is
still always unshared first just like before.
2025-03-20 06:28:18 +09:00
Lennart Poettering b0fe8df5a9 Several fixlets for Coverity (#36791) 2025-03-19 22:27:00 +01:00
Yu Watanabe bb8c74d7f2 Introduce ConditionVersion (#36468)
Add a new condition which can check against systemd version.

        $ systemctl --version
        systemd 258 (258~devel-g53ca5f6)

        $ systemd-analyze condition 'ConditionVersion=systemd>255'
        test.service: ConditionVersion=>255 succeeded.

        $ systemd-analyze condition 'ConditionVersion=systemd>260'
        test.service: ConditionVersion=>260 failed.

        $ systemd-analyze condition 'ConditionVersion=systemd>=258'
        test.service: ConditionVersion=>=258 succeeded.

        $ systemd-analyze condition 'ConditionVersion=systemd>=257.1'
        test.service: ConditionVersion=>=257.1 succeeded.

        $ uname -r
        6.12.13-200.fc41.aarch64

        $ systemd-analyze condition 'ConditionVersion=kernel > 4.4'
        test.service: ConditionVersion=kernel > 4.4 succeeded.

        $ systemd-analyze condition 'ConditionVersion=kernel > 6.20'
        test.service: ConditionVersion=kernel > 6.20 failed.

        $ systemd-analyze condition 'ConditionVersion=kernel < 9.0'
        test.service: ConditionVersion=kernel < 9.0 succeeded.
2025-03-20 06:15:35 +09:00
Lennart Poettering bb160976b0 cgroup: whenever we migrate a PID to a unit, explicitly drop unit from empty notification queue
A unit might be pending in the empty queue still when we add a PID to
the cgroup. At that point, let's explicitly remove the unit from that
queue.

Fixes: #36781
2025-03-19 21:40:33 +01:00
Lennart Poettering 0015502168 tpm2-util: return better errors if we try to unlock a tpm key on the wrong tpm
Let's improve error handling in case one tries to unlock a TPM2 locked
volume on a different machine via TPM than it was originally enrolled
on. Let's recognize this case and print a clearer error message.
2025-03-19 21:27:54 +01:00
Daan De Meyer 0e0f4cc60c various verity generator tweaks (#36802) 2025-03-19 19:26:03 +01:00
Lennart Poettering f21090d217 generator: skip fsck early for non-blockdev file systems, or file systems that are always read-only 2025-03-19 18:18:43 +01:00
Lennart Poettering 179dcf924f sd-event: make pidfd copy in event_add_child_pidref()
So far we'd directly use the pidfd passed into event_add_child_pidref(),
hoping it would not be closed by the caller before we are done. This was
violated by vmspawn however.

Let's make this safe, and simply duplicate the fd, and make us
independent of the caller.
2025-03-19 18:14:24 +01:00
Lennart Poettering bed546d187 veritysetup-generator: repeat format string arguments a bit less 2025-03-19 16:32:02 +01:00
Lennart Poettering 64f8df2f31 veritysetup-generator: specify source for generator_open_unit_file() 2025-03-19 16:32:02 +01:00
Lennart Poettering eedd0b9886 veritysetup-generator: exit on first error 2025-03-19 16:32:02 +01:00
Lennart Poettering 0ec1a83eea veritysetup: automatically generate unit name, instead of hardcoding it 2025-03-19 16:32:02 +01:00
Daan De Meyer da42c1441b fmf: Drop support for dist-git-source: true
In preparation for moving the fmf stuff to the fedora spec repo instead
of maintaining it upstream, let's drop support for dist-git-source: true
which won't be needed anymore when we move the fmf stuff to the Fedora
spec repository.
2025-03-19 13:01:24 +01:00
Daan De Meyer 91418656e8 fmf: Stop creating /etc/pacman.d/gnupg mountpoint
Not needed anymore with latest versions of mkosi.
2025-03-19 13:01:24 +01:00
Daan De Meyer 3f2700287f fmf: Drop btrfs workaround
We switched to ext4 in mkosi.repart itself, so drop the workaround
in the fmf integration test script.
2025-03-19 13:01:24 +01:00
Daan De Meyer 33bcafe6d1 packit: Use same specfile revision as mkosi uses 2025-03-19 13:01:17 +01:00
Daan De Meyer 197e3b5a8c packit: Enable use_target_repo_for_fmf_url option
Currently this is picked up from the main branch of the fork which is
suboptimal. The packit folks implemented this new option for us which
should fix the problem.
2025-03-19 12:34:31 +01:00
Daan De Meyer 511bf79b4e userdb: Add userdb.user.* and userdb.group.* credentials (#36740)
Let's allow providing extra userdb users and groups via credentials.
Similarly to systemd-udev-load-credentials.service, we ship
systemd-userdb-load-credentials.service which transform the JSON
user/group records provided via the corresponding credentials to static
userdb dropins in /run/userdb.
2025-03-19 10:30:52 +01:00
Daan De Meyer 38748596f0 core: Make DelegateNamespaces= work for user managers with CAP_SYS_ADMIN
Currently DelegateNamespaces= only works for services spawned by the
system manager. User managers will always unshare the user namespace
first even if they're running with CAP_SYS_ADMIN.

Let's add support for DelegateNamespaces= for user managers if they're
running with CAP_SYS_ADMIN. By default, we'll still delegate all namespaces
for user managers, but this can now be overridden by explicitly passing
DelegateNamespaces=.

If a user manager is running without CAP_SYS_ADMIN, the user manager is
still always unshared first just like before.
2025-03-19 10:01:19 +01:00
Daan De Meyer b281686b4f test: Fix formatting 2025-03-19 10:01:19 +01:00
Daan De Meyer a2425e8a8b run: Stop agents before we drop privileges
After dropping privileges, we won't be able to stop agents anymore
as our signals will get ignored.
2025-03-19 10:01:19 +01:00
Daan De Meyer 9e34c34b7b sd_bus_open_user_machine(): Don't shortcut without necessary env
Don't shortcut if we don't have the necessary environment variables
set in sd_bus_open_user_machine().
2025-03-19 10:01:19 +01:00
Daan De Meyer f49b7404b2 capability-util: Ignore unknown capabilities instead of aborting
capability_ambient_set_apply() can be called with capability sets
containing unknown capabilities. Let's not crash when this is the
case but instead ignore the unknown capabilities.

This fixes a crash when running the following command:

"systemd-run -p "AmbientCapabilities=~" --wait --pipe id"

Fixes d5e12dc75e
2025-03-19 10:01:19 +01:00
Daan De Meyer 87ddf5188b TEST-07-PID1.private-pids: Use --machine=testuser@.host instead of runas
Let's use the systemd way to run systemd-run as a different user instead
of setpriv.
2025-03-19 10:01:19 +01:00
Daan De Meyer 9a78b5eb7e TEST-07-PID1.delegate-namespaces: Actually run the testcases 2025-03-19 10:01:19 +01:00
Daan De Meyer b7602662cb TEST-07-PID1.delegate-namespaces: Fix testcase_pid()
Make sure the test has its own /proc and skip it in containers as
MountAPIVFS=yes in a container always results in a read-only /proc/sys
which means the test can't write to /proc/sys/kernel/ns_last_pid.
2025-03-19 10:01:16 +01:00
Daan De Meyer aae4748464 TEST-07-PID1.delegate-namespaces: Make sure fully visible procfs is available
To be able to mount /proc inside an unprivileged user namespace, we have
to make sure a fully visible procfs is available on the host, so let's make
sure that's the case.
2025-03-19 10:00:45 +01:00
Daan De Meyer 918a188fda core: Also check if we can mount /proc if pid namespace is delegated
If the pid namespace is delegated, it doesn't matter if we have CAP_SYS_ADMIN,
we'll still fail to mount /proc if part of it is masked on the host so also
check if we can mount /proc if the pid namespace is delegated.
2025-03-19 10:00:45 +01:00
Daan De Meyer c8912e3d83 TEST-07-PID1.delegate-namespaces: Fix testcase_network() 2025-03-19 10:00:45 +01:00
Daan De Meyer ad9b5d4732 bus-unit-util: Fix DelegateNamespaces= parser
Similarly to the config file parse method, let's fix the systemd-run
parser as well.

Follow up for 11b982053b
2025-03-19 10:00:45 +01:00
Daan De Meyer af6a8b6969 exec-invoke: Rename various variables from has_ to have_
All of these encode information of the current process, so have_ is
more approriate than has_, which refers to something else.
2025-03-19 10:00:45 +01:00