Commit Graph

9217 Commits

Author SHA1 Message Date
Yu Watanabe
7f2175eabb udevadm: introduce cat command
This introduces 'udevadm cat' command, that shows udev rules files or
udev.conf, which may be useful for debugging.

Closes #35818.
2025-01-23 22:23:45 +09:00
Yu Watanabe
7cb4508c5a udevadm-verify: chase specified paths
Also, when a filename is specified, also search udev rules file in
udev/rules.d directories.

This also refuses non-existing files, and file neither nor a regular
nor a directory, e.g. /dev/null.
2025-01-23 22:23:45 +09:00
Andrew Sayers
e5038e63e9 Clarify that Conflicts= only applies when starting units
The "vice versa" in the old text could be interpreted as either
(wrong) "stopping the former will start the latter", or
(right) "starting the latter will stop the former".

Rephrase to avoid that ambiguity.
2025-01-23 18:14:47 +09:00
Yu Watanabe
90cf374e45 run: add --job-mode= argument (#34708)
systemctl has a --job-mode= argument, and adding the same argument to
systemd-run is useful for starting transient scopes with dependencies.
For example, if a transient scope BindsTo a service that is stopping,
specifying --job-mode=replace will wait for the service to stop before
starting it again, while the default job mode of "fail" will cause the
systemd-run invocation to fail.
2025-01-23 18:11:30 +09:00
Gavin Li
706a953504 run: add --job-mode= argument
systemctl has a --job-mode= argument, and adding the same argument to
systemd-run is useful for starting transient scopes with dependencies.
For example, if a transient scope BindsTo a service that is stopping,
specifying --job-mode=replace will wait for the service to stop before
starting it again, while the default job mode of "fail" will cause the
systemd-run invocation to fail.
2025-01-23 02:08:32 -05:00
Yu Watanabe
fe9753841f network/radv: add [IPv6RoutePrefix] Preference= setting 2025-01-22 20:48:31 +00:00
Yu Watanabe
c1b7db56e5 udevadm-test: allow to specify extra directories to load udev rules files
This adds -D/--extra-rules-dir=DIR switch for 'udevadm test' command.
When specified, udev rules files in the specified directory will be also
loaded. This may be useful for debugging udev rules by copying some udev
rules files to a temporary directory.
2025-01-22 20:46:42 +00:00
Mike Yuan
9c039ef5ff pidfd-util: preferably acquire pidfd inode id through name_to_handle_at()
See rationales described in kernel commit:
b3caba8f7a
2025-01-22 21:41:44 +01:00
Lennart Poettering
5cd7b455e0 homectl: add support for creating users with alias names 2025-01-21 09:59:09 +01:00
Luca Boccassi
606c5e7580 ukify: add --policy-digest option
Uses the newly added policy-digest verb of systemd-measure, for the same
purpose: build a UKI and get digests for the .pcrsig section out, so
that they can be offline signed and reattached
2025-01-21 09:19:49 +01:00
Luca Boccassi
175cb87a1c measure: add policy-digest verb
When doing offline signing we need to know the exact payload
to sign, and the 'calculate' verb doesn't really show that, it
shows the PCR values. But what we sign is the hash of the policy.
So add a new verb that outputs the json payload that goes in the
.pcrsig section, without the .sig object, so that we can take them
and give the .pol object to an offline and asynchronous signing
service, such as SUSE's Open Build Service, and then add the .sig
object to the json and attach it to a UKI.
2025-01-21 00:07:58 +00:00
Mike Yuan
9bfc13e93a pidfd: cache our own pidfd inode id, and use it at various places (#36060)
This is split out of and preparation for #35224, but makes a ton of
sense on its own
2025-01-21 00:16:12 +01:00
Lennart Poettering
7933e971ce pid1: pass pidfdids to invoked services in $MAINPIDFDID and $MANAGERPIDFDID 2025-01-20 21:51:40 +01:00
Yu Watanabe
25a2e4738b udevadm-control: allow to enable/disable trace logging in systemd-udevd
Should be useful for debugging udev rules.
2025-01-21 04:12:18 +09:00
Yu Watanabe
695c592a03 udev-config: allow to enable trace logging through kernel command line
This adds udev.trace[=BOOL] kernel command line option to control trace
logging.
2025-01-21 04:12:18 +09:00
Lennart Poettering
50ffe4058c udev-rules: introduce OPTIONS="dump" (#36069)
split out of #35968.
2025-01-20 17:59:40 +01:00
Hendrik Wolff
5c6703e2d8 man/systemd.special: Add suspend-then-hibernate.target to sleep.target documentation 2025-01-19 11:47:09 +09:00
nl6720
a153d7cbd2 man: replace "-" with "none" in cryptsetup commands and crypttab
`none` is more explicit and harder to overlook than `-` which in certain
contexts could be misunderstood to mean standard input.
2025-01-19 04:37:14 +09:00
Yu Watanabe
b4ffb77669 udev-rules: introduce OPTIONS="dump" token
Should be useful for debugging.
2025-01-19 03:09:06 +09:00
Lennart Poettering
8af1b296cb pid1: when a password is requested during PAMName= processing, query it via the ask-password logic 2025-01-18 11:45:44 +00:00
Yu Watanabe
8846df63fa udevadm-test: introduce -v/--verbose option to show verbose log messages
Currently this does not show any extra log messages. In later commits,
more verbose log messages will be added.
2025-01-18 04:19:52 +09:00
Lennart Poettering
09fbff57fc pid1: add GracefulOptions= setting to .mount units
This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking compat,
but is generally be useful.
2025-01-15 21:05:06 +01:00
Lennart Poettering
ef5f72437e run0: allow explicit control of service manager activation for run0 sessions
This adds a new --lightweight=yes/no switch which allows controlling
whether the invoked service will have the service manager around or not.

Moreover, this changes that if the target user is root it will now
support to the lightweight mode, i.e. run0 towards root will no longer
pull in the service manager (a real tty login via getty still will
though!).

My thinking here is that quickly raising privileges via run0 probably
shouldn't be considered a proper login but just something short lived,
temporary for a single command or similar.
2025-01-15 17:03:21 +01:00
Lennart Poettering
cf8f6cd057 logind: introduce "user-light" session class
This new session class is to "user" what "background" is to
"background-light": it doesn't cause the per-user service manager to
start.

This new session class is now the default if no session class was
provided at session registration time and the following conditions hold:

1. The session is not graphical
2. The user is not a regular user (but not root)

Or in other words root and system users won't get a service manager
started automatically if they go through a PAM session as part of things
like cron or ftp. They will however still get one if they log in
graphically.

This changes behaviour a bit, but hopefully in OK was.

This also makes "background-light" for system users incl. root.

This addresses one of the ideas discussed in #34988.
2025-01-15 17:03:21 +01:00
Lennart Poettering
390dffb862 man: also fix documentation of start-limit-hit 2025-01-15 10:42:10 +01:00
Jeremy Linton
2572bf6a39 confidential-virt: add detection for aarch64 CCA
The arm confidential compute architecture (CCA) provides a platform design for
confidential VMs running in a new realm context.

This can be detected by the existence of a platform device exported for the
arm-cca-guest driver, which provides attestation services via the realm
services interface (RSI) to the Realm Management Monitor (RMM).

Like the other methods systemd uses to detect Confidential VM's, checking
the sysfs entry suggests that this is a confidential VM and should only be
used for informative purposes, or to trigger further attestation.

Like the s390 detection logic, the sysfs path being checked is not labeled
as ABI, and may change in the future. It was chosen because its
directly tied to the kernel's detection of the realm service interface rather
to the Trusted Security Module (TSM) which is what is being triggered by the
device entry. The TSM module has a provider string of 'arm-cca-guest' which
could also be used, but that (IMHO) doesn't currently provide any additional
benefit except that it can fail of the module isn't loaded.

More information can be found here:
https://developer.arm.com/documentation/den0125/0300

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2025-01-15 13:51:12 +09:00
Daan De Meyer
bbe9e03f80 man: Clarify systemd-notify and sd_notify() PID documentation
Let's clarify more explicitly that privileged calls to
systemd-notify --pid= and sd_pid_notify() effectively override any
configured NotifyAccess=main|exec for a service.
2025-01-14 21:07:06 +00:00
Sea-Eun Lee
015a3b8cb1 oomd: support reloading configuration at runtime 2025-01-14 14:42:23 +01:00
Daan De Meyer
6309efbf31 dissect: Use COPY_MERGE
When copying a directory from or to an image, let's always merge
with existing directories instead of failing with "File Exists".

Fixes https://github.com/systemd/mkosi/issues/3342.
2025-01-14 11:13:25 +01:00
Zbigniew Jędrzejewski-Szmek
ad7e0fdbf9 Extend elf package metadata to pe/coff files (#35681) 2025-01-11 13:12:39 +01:00
Lennart Poettering
fa8b70f2c8 userdb: define new 64K "foreign UID" range (#35932)
This is establish the basic concepts for #35685, in the hope to get this
merged first.

This defines a special, fixed 64K UID range that is supposed to be used
by directory container images on disk, that is mapped to a dynamic UID
range at runtime (via idmapped mounts).

This enables a world where each container can run with a dynamic UID
range, but this in no way leaks onto the disk, thus making supposedly
dynamic, transient UID range assignments persistent.

This is infrastructure later used for the primary part of #35685: unpriv
container execution with directory images inside user's home dirs, that
are assigned to this special "foreign UID range".

This PR only defines the ranges, synthesizes NSS records for them via
userdb, and then exposes them in a new "systemd-dissect --shift" command
that can re-chown a container directory tree into this range (and in
fact any range).

This comes with docs. But no tests. There are tests in #35685 that cover
all this, but they are more comprehensive and also test nspawn's hook-up
with this, hence are excluded from this PR.
2025-01-10 13:49:11 +01:00
Lennart Poettering
c0041cd8f1 pam: add session class "none" to disable logind sessions (#35171)
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.

---

Closes: #34988
2025-01-09 14:08:06 +01:00
Lennart Poettering
5ae3172867 hwids: add a new efi firmware type of device entry (#35747)
This change adds a new firmware type device entry for the .hwids
section.
It also adds compile time validations and appropriate unit tests for
them.
chid_match() and related helpers have been updated accordingly.

Duplicate of https://github.com/systemd/systemd/pull/35281
Last review feedback's from this above PR has been incorporated and
merged.

@anonymix007
2025-01-08 22:31:48 +01:00
Lennart Poettering
55e4946f9c dissect: add new --shift command 2025-01-08 21:54:19 +01:00
Lennart Poettering
44eb6b81db userdb: synthesize stub user records for the foreign UID 2025-01-08 21:41:03 +01:00
Lennart Poettering
b253555d6b udev/net: add three settings for ethtool features (#35906)
Closes #31415.
Closes #32979.
2025-01-08 21:37:21 +01:00
Yu Watanabe
844295b2bb udev/net: add PartialGenericSegmentationOffload= setting
Closes #32979.
2025-01-09 03:49:29 +09:00
Yu Watanabe
ac24d356fe udev/net: add ReceiveFCS= and ReceiveAll= settings
Closes #31415.
2025-01-09 03:49:29 +09:00
Lennart Poettering
94634b4b03 pid1: add D-Bus API for removing delegated subcgroups
When running unprivileged containers, we run into a scenario where an
unpriv owned cgroup has a subcgroup delegated to another user (i.e. the
container's own UIDs). When the owner of that cgroup dies without
cleaning it up then the unpriv service manager might encounter a cgroup
it cannot delete anymore.

Let's address that: let's expose a method call on the service manager
(primarly in PID1) that can be used to delete a subcgroup of a unit one
owns. This would then allow the unpriv service manager to ask the priv
service manager to get rid of such a cgroup.

This commit only adds the method call, the next commit then adds the
code that makes use of this.
2025-01-08 15:27:25 +01:00
Yu Watanabe
2bc733d9b0 units: introduce systemd-udevd-varlink.socket
Co-authored-by: David Tardon <dtardon@redhat.com>
2025-01-07 20:31:15 +09:00
Ani Sinha
5d0ac3528b hwids: add a new uefi firmware type of device entry
This change adds a new uefi firmware type device entry for the .hwids section.
It also adds necessary changes for ukify.py.
2025-01-05 09:40:05 +05:30
Daan De Meyer
276890d629 ptyfwd: Add --read-only option 2025-01-03 21:14:47 +01:00
Daan De Meyer
d0d647e084 Introduce systemd-pty-forward (#35761)
This allows running a command with tinted terminal background.
2025-01-03 19:34:42 +01:00
Daan De Meyer
8224a48da9 Introduce systemd-pty-forward
This allows running a command with tinted terminal background.
2025-01-03 17:07:33 +01:00
Lennart Poettering
41c2a5b0b9 dissect: show all kinds of images in --discover
Given that systemd-dissect can nowadays operate on plain directories,
let's include directory images in the --discover output too.

Replace the filter with a filter for hidden images instead, as suddenly
the root fs image (which is a directory image ".host") otherwise shows up.
2025-01-03 10:12:23 +01:00
Lennart Poettering
36d2096b84 debug-generator: rework from post-merge review #35410 (#35696)
- https://github.com/systemd/systemd/pull/35410#discussion_r1893664993
- https://github.com/systemd/systemd/pull/35410#discussion_r1893667581
2025-01-03 09:34:50 +01:00
Ronan Pigott
90ee2c59cc pam: add session class "none" to disable logind sessions
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.
2025-01-02 20:18:15 -07:00
Antonio Alvarez Feijoo
e6922ac334 man/debug-generator: replace "main system" with "host" 2025-01-02 14:59:00 +01:00
Yu Watanabe
7bbe9ad796 network: introduce system wide default setting for DHCPv4 client ID
Typically, the same client identifier setting is used for all
interfaces. Hence, better to provide the system-wide setting to specify
the client identifier.
2024-12-30 10:27:39 +09:00
Yu Watanabe
f1dbc4f8cc man/networkd.conf: update section explanation
These section contains not only DUID related settings.

Follow-up for 418f2dc755.
2024-12-30 10:15:52 +09:00