Commit graph

8291 commits

Author SHA1 Message Date
Lennart Poettering 25f8d3856a
Merge pull request #30884 from poettering/logind-background-light
logind: add "background-light" + "manager" session classes
2024-01-11 21:20:01 +01:00
Lennart Poettering a50666e376 id128: add --no-pager, --no-legend, --json=/-j switches to systemd-id128 tool 2024-01-11 17:54:19 +01:00
Lennart Poettering 0f6827bdd1 man: document the expanded catalogue of session classes 2024-01-11 17:47:41 +01:00
Lennart Poettering 658dc909dc man: fix references to systemd.exec(5)
For some reason the section for the systemd.exec man page was added
incorrectly and then copypasted everywhere else incorrectly too. Let's
fix that.
2024-01-11 12:19:44 +00:00
Antonio Alvarez Feijoo 5e16328506 analyze: clarify that security --offline=true requires an argument
Without `--root` or `--image`, the `security` command inspects all currently
loaded service units if no unit name is specified. But with `--root` or
`--image` with `--offline=true`, the `security` command exits silently if no
unit name is specified.

Also, fixed description of `--root` and `--image` in the man page, and added
missing `--unit` option to help text.
2024-01-11 12:19:20 +00:00
Carlos Garnacho 501d8b8bc6 logind: Mark LidClosed property as "emits change"
It may be useful for DEs to follow changes on this property, esp. now that
recent UPower has removed its own lid handling code.

Related: 07565ef6a1
2024-01-10 19:31:06 +00:00
Lennart Poettering 9a70dc02c6
Merge pull request #30786 from yuwata/udev-net-link-property
udev/net: introduce [Link] Property= setting and friends
2024-01-10 15:56:29 +01:00
Lennart Poettering a795ec8100
Merge pull request #30839 from yuwata/detect-virt-google
detect-virt: add Google Compute Engine support
2024-01-10 09:55:44 +01:00
Yu Watanabe 046286e863 udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings
The applied order is equivalent to Environment=, PassEnvironment=, and
UnsetEnvironment= for [Service] or so.
2024-01-10 04:33:51 +09:00
Yu Watanabe 12b1e04073 man: fix indentation 2024-01-10 03:50:32 +09:00
Yu Watanabe 9b0688f491 virt: add Google Compute Engine support
See https://cloud.google.com/run/docs/container-contract#sandbox
2024-01-10 03:08:31 +09:00
Mike Yuan 435e1098ee
core: allow fstab-style nodes in mount/swap What=
Closes #28989
2024-01-10 02:07:18 +08:00
Luca Boccassi c3f4d9f9a4
Merge pull request #30842 from aafeijoo-suse/analyze-q-man-help-fix
analyze: minor fixes
2024-01-09 10:40:19 +00:00
Antonio Alvarez Feijoo ca02969379
analyze: man and --help fixes
man:
- `verify` requires an argument
- `security` does not require an argument
- `fdstore` requires an argument
- `image-policy` requires an argument

`--help` text:
- missing `image-policy` command
- `cat-config` requires NAME or PATH
2024-01-09 10:11:59 +01:00
Antonio Alvarez Feijoo 7c0e0bbb6b
analyze: fix -q option
Follow-up to 52117f5af8
2024-01-09 09:05:50 +01:00
Mike Yuan fa724cd52c
networkd/wireguard: support network.wireguard.* credentials
Closes #26702
2024-01-09 15:25:30 +08:00
Yu Watanabe 10b8bb5495 man: drop unexpected dot 2024-01-09 10:52:18 +09:00
Lennart Poettering a1bb30de7f varlink: add "ssh:" transport
This uses openssh 9.4's -W support for AF_UNIX. Unfortunately older versions
don't work with this, and I couldn#t figure a way that would work for
older versions too, would not be racy and where we'd still could keep
track of the forked off ssh process.

Unfortunately, on older versions -W will just hang (because it tries to
resolve the AF_UNIX path as regular host name), which sucks, but hopefully this
issue will go away sooner or later on its own, as distributions update.

Fedora is still stuck at 9.3 at the time of posting this (even on
Fedora), even though 9.4, 9.5, 9.6 have all already been released by
now.

Example:
        varlinkctl call -j ssh:root@somehost:/run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt '{"text":"foobar"}'
2024-01-08 23:24:45 +01:00
Lennart Poettering c9f096969a
Merge pull request #30827 from poettering/network-generator-creds
network-generator: pick up .netdev/.link/.network configuration via c…
2024-01-08 15:02:02 +01:00
Lennart Poettering 1a30285590 network-generator: pick up .netdev/.link/.network configuration via credentials
To me this is the last major basic functionality that couldn't be
configured via credentials: the network.

We do not invent any new format for this, but simply copy relevant creds
1:1 into /run/systemd/network/ to open up the full functionality of
networkd to VM hosts.
2024-01-08 12:59:08 +01:00
Lennart Poettering 19b8e712d8 hostnamed: expose local AF_VSOCK CID among other host info
This is a host identifier of major relevance, since it is how you
connect to this system if it is a VM, hence expose this nicely.
2024-01-08 10:30:41 +01:00
Lennart Poettering 8ef31e1f13
Merge pull request #29692 from H5117/fix_pkcs11_uri
cryptenroll: change class in provided PKCS#11 URI if necessary
2024-01-05 12:14:26 +01:00
Yu Watanabe c270e41f5e man: fix typo
Follow-up for 7d93e4af80.
2024-01-05 19:08:12 +09:00
Adrian Vovk cc51085a41 core: Add %D specifier for $XDG_DATA_HOME
We already have specifiers that resolve to $XDG_STATE_HOME, and
$XDG_CONFIG_HOME. $XDG_DATA_HOME is in a similar vein.

It allows units belonging to the user service manager to correctly look
into ~/.local/share. I imagine this would be most useful inside of
condition checks (i.e. only run a service on session startup if some
data is not found in ~/.local/share) or in the inotify monitoring of a
.path unit
2024-01-05 11:03:06 +01:00
Vladimir Stoiakin 85828ef920 cryptenroll: change class in provided PKCS#11 URI if necessary
cryptenroll accepts only PKCS#11 URIs that match both a certificate and a private key in a token.
This patch allows users to provide a PKCS#11 URI that points to a certificate only, and makes possible to use output of some PKCS#11 tools directly.
Internally the patch changes 'type=cert' in the provided PKCS#11 URI to 'type=private' before storing in a LUKS2 header.

Fixes: #23479
2024-01-05 12:32:36 +03:00
Sergei Zhmylev 25aa35d465 journalctl: add --exclude-identifier option 2024-01-04 23:21:39 +01:00
Lennart Poettering 6d78dc2827 creds: rename "tpm2-absent" encryption to "null" encryption
This is what it is after all: encryption with a NULL key. This is more
descriptive, but also relevant since we want to use this kind of
credentials in a different context soon: for carrying pcrlock data into
a UKI. In that case we don#t want encryption, since the pcrlock data is
intended to help unlocking secrets, hence should not be a secret itself.

This only changes the code labels and the way this is labelled in the
output. We retain compat with the old name.
2024-01-04 22:56:48 +01:00
Luca Boccassi 81a183800f tmpfiles: add --purge switch
Any file/directory created by a tmpfiles.d will be deleted. Useful for
purge/factory reset patterns.
2024-01-04 17:36:43 +01:00
Mike Yuan 5317451f12
man/loginctl: document "self" and "auto" special session IDs
session-status automatically uses "auto" if no ID is specified,
but show-session shows the manager's properties. Let's document
these special values so that users of show-session can benefit too.
2024-01-04 19:26:47 +08:00
Mike Yuan 771240fa3d
man/loginctl: use <literal> to quote possible values of --kill-whom= 2024-01-04 18:59:38 +08:00
Lennart Poettering 2a02a8db91
Merge pull request #26663 from poettering/vpick
add new "vpick" concept for automatically picking newest resource from .v/ dir containing versioned files
2024-01-03 22:17:32 +01:00
Yu Watanabe 82a1597778
Merge pull request #28797 from Werkov/eff_limits
Add MemoryMaxEffective=, MemoryHighEffective= and TasksMaxEff…  …ective= properties
2024-01-04 05:38:06 +09:00
Michal Sekletar 508b4786e8 logind: don't setup idle session watch for lock-screen and greeter
Reason to skip the idle session logic for these session classes is that
they are idle by default.
2024-01-04 05:27:41 +09:00
Yu Watanabe aea57b1415
Merge pull request #28836 from msekletar/aux-scope
core/manager: add dbus API to create auxiliary scope from running service
2024-01-04 04:52:39 +09:00
Lennart Poettering 7d93e4af80 man: document the new vpick concept 2024-01-03 18:38:46 +01:00
Lennart Poettering de84484e7b
Merge pull request #29940 from poettering/stub-confext-pickup
stub/sysext: pick up confexts from ESP, too
2024-01-03 17:40:36 +01:00
Michal Sekletar 84c01612de core/manager: add dbus API to create auxiliary scope from running service
This commit introduces new D-Bus API, StartAuxiliaryScope(). It may be
used by services as part of the restart procedure. Service sends an
array of PID file descriptors corresponding to processes that are part
of the service and must continue running also after service restarts,
i.e. they haven't finished the job why they were spawned in the first
place (e.g. long running video transcoding job). Systemd creates new
scope unit for these processes and migrates them into it. Cgroup
properties of scope are copied from the service so it retains same
cgroup settings and limits as service had.
2024-01-03 13:50:41 +01:00
Lennart Poettering 4e1f0037b8 units: add a tpm2.target synchronization point and small generator that pulls in
Distributions apparently only compile a subset of TPM2 drivers into the
kernel. For those not compiled it but provided as kmod we need a
synchronization point: we must wait before the first TPM2 interaction
until the driver is available and accessible.

This adds a tpm2.target unit as such a synchronization point. It's
ordered after /dev/tpmrm0, and is pulled in by a generator whenever we
detect that the kernel reported a TPM2 to exist but we have no device
for it yet.

This should solve the issue, but might create problems: if there are TPM
devices supported by firmware that we don't have Linux drivers for we'll
hang for a bit. Hence let's add a kernel cmdline switch to disable (or
alternatively force) this logic.

Fixes: #30164
2024-01-03 13:49:02 +01:00
Michal Koutný 93f8e88d23 cgroup: Restrict effective limits with global resource provision
Global resource (whole system or root cg's (e.g. in a container)) is
also a well-defined limit for memory and tasks, take it into account
when calculating effective limits.
2024-01-03 13:43:04 +01:00
Michal Koutný 4fb0d2dc14 cgroup: Add EffectiveMemoryMax=, EffectiveMemoryHigh= and EffectiveTasksMax= properties
Users become perplexed when they run their workload in a unit with no
explicit limits configured (moreover, listing the limit property would
even show it's infinity) but they experience unexpected resource
limitation.

The memory and pid limits come as the most visible, therefore add new
unit read-only properties:
- EffectiveMemoryMax=,
- EffectiveMemoryHigh=,
- EffectiveTasksMax=.

These properties represent the most stringent limit systemd is aware of
for the given unit -- and that is typically(*) the effective value.

Implement the properties by simply traversing all parents in the
leaf-slice tree and picking the minimum value. Note that effective
limits are thus defined even for units that don't enable explicit
accounting (because of the hierarchy).

(*) The evasive case is when systemd runs in a cgroupns and cannot
reason about outer setup. Complete solution would need kernel support.
2024-01-03 13:37:08 +01:00
Lennart Poettering 39e0c237f1 stub: pick up confexts from the ESP as well
This does what we do for system extension also for configuration
extension.

This is complicated by the fact that we previously looked for
<uki-binary>.d/*.raw for system extensions. We want to measure sysexts
and confexts to different PCRs (13 vs. 12) hence we must distinguish
them, but *.raw would match both kinds.

This commit solves this via the following mechanism: we'll load confexts
from *.confext.raw and sysexts from *.raw but will then enclude
*.confext.raw from the latter. This preserves compatibility but allows
us to somewhat reasonable distinguish both types of images.

The documentation is updated not going into this detail though, and
instead now claims that sysexts shall be *.sysext.raw and confexts
*.confext.raw even though we actually are more lenient than this. This
is simply to push people towards using the longer, more descriptive
suffixes.

I added an XML comment (<!-- … -->) about this to the docs, so that
whenever somebody notices the difference between code and docs
understands why and leaves it that way.
2024-01-03 10:38:34 +01:00
Yu Watanabe 778823fd52 backlight: supprt ID_LEDS_CLAMP udev property for leds subsystem devices
Closes #30507.
2024-01-03 09:30:41 +09:00
Yu Watanabe cb0a3b8c14 network/route: drop TTL propagate support for MPLS routes
This effectively reverts 9b88f20aba.

We do not support MPLS routes, only IPv4 or IPv6 routes are supported.
2024-01-03 08:41:53 +09:00
Chris Simons 9ef362bf3d
machinectl: add restart convenience alias (#30625) 2023-12-28 07:09:42 +09:00
David Tardon af29d0b179 man: rewrite as <group> 2023-12-26 13:10:36 +01:00
David Tardon 0fd5f9fb50 man: fix markup
<arg> is not allowed inside <title>.
2023-12-26 13:10:36 +01:00
David Tardon 7f9d96d4c5 man: move </variablelist> to the right place 2023-12-26 13:10:35 +01:00
David Tardon b239fc7250 man: fix <cmdsynopsis> content
Inline text is not allowed.
2023-12-26 13:10:35 +01:00
David Tardon 20dcd73a28 man: fix markup
<option> is not allowed in <cmdsynopsis>.
2023-12-26 13:10:35 +01:00
David Tardon dfa6c32ad9 man: restrict <command> to the actual command 2023-12-26 13:10:35 +01:00