Commit Graph
9933 Commits
Author SHA1 Message Date
Lennart Poettering e2f23b6deb man: document new varlinkctl feature 2026-02-09 10:54:18 +01:00
Zbigniew Jędrzejewski-Szmek 15777d6d5c report: many smaller clean-ups/tweaks to systemd-report (#40598)
/cc @keszybz
2026-02-09 10:28:29 +01:00
Daan De Meyer 7d4ea41bd1 bootctl parts of installer PR (#40447)
This contains the "bootctl install" related work from the #38764 split
out, but also includes the preparatory work already split out into
#40446.

I'll rebase this PR once the prep work is merged.

This has a simple CI test already, and has docs
2026-02-09 09:46:39 +01:00
Matteo Croce c1bf450fa0 oomd: implement a prekill varlink event
When a cgroup is selected for termination, send varlink messages
to hooks registered in `/run/systemd/oomd.prekill-hooks/`.
oomd waits up to `PreKillHookTimeoutSec=` seconds for response
before proceeding with the kill.
2026-02-09 02:05:57 +01:00
Lennart Poettering e180087038 man: add super basic man page 2026-02-07 23:36:48 +01:00
Lennart Poettering 91b3620b07 bootctl: optionally include backing disk name in efi boot option description 2026-02-06 23:16:49 +01:00
Alessandro Astone 30a1a29d4e man/sd-login: Document the uaccess and xaccess udev tags
Fixes: #4288
2026-02-06 17:42:17 +01:00
Alessandro Astone 563b5dedb7 man: Update docs for ExtraDeviceAccess 2026-02-06 16:20:18 +01:00
gvenugo3 8950f64263 sleep: allow HibernateDelaySec and low-battery hibernation to work together
Previously, setting HibernateDelaySec= would disable ACPI battery trip
point (_BTP) alarms, forcing the system to rely solely on software
polling for battery checks. This could result in the battery draining
to 0% between polling intervals, causing data loss.

Now, when ACPI _BTP is available AND HibernateDelaySec= is set, both
mechanisms work together. The system will hibernate on whichever comes
first: low battery (instant hardware alarm) or the configured timeout.

This also properly respects HibernateOnACPower=no by resetting the
timer while on AC power, matching the documented behavior.

Fixes: https://github.com/systemd/systemd/issues/26498
2026-02-05 10:28:47 +01:00
Lennart Poettering 13d82876f5 sysext: Skip refresh if no changes are found (#39980)
When the extensions for the final system are already set up from the
    initrd we should avoid disrupting the boot process with the remount
    (which currently isn't atomic) and the daemon reload for
systemd-confext and systemd-sysext. Similarly, when sysupdate ran and
updated extensions it's best to avoid the remount and daemon reload if
    no changes are found.
    To do this, encode the current extension state in more detail than
    before where only the names of the extensions where encoded in the
overlay mount. This can also be used to provide more details about the
    extension origin in "systemd-sysext status (--json=)". During the
refresh add a check whether the old state matches the new state and in
    this case skip the refresh unless the user provides a flag to always
    refresh. Besides the extension name and the resolved path the best
method for identification is the verity hash but that is not available
for plain image files or directories. Therefore, also include data to
check for file/directory replacements. The creation/modification times
are not always real on reproducible images or extracted archive content.
    The file handle together with the unique mount ID is the next best
identifier we can use when we have no verity hash. Fall back to an inode
when we get no handle. With the creation/modification time and the path
this should be good enough. Using a unique mount ID is important (with
a fallback to the regular non-unique mount ID) instead of st_dev because
    st_dev gets reused too easily, e.g., by a loop device mount and the
mount ID helps to catch this. For the mount ID to be valid it has to be
resolved before we enter the new mount namespace. Thus, it gets provided
    by the image dissect logic and handed over to the sysext subprocess
    which runs in a new mount namespace.
    Luckily, we can rule out online modification of directories or image
files because this is anyway not well supported with overlay mounts, so
we don't do a file checksum nor do we recurse into a directory to look
    for the most recently touched files.  But, as said, with the
    always-refresh flag one can force a reload.
2026-02-04 10:30:10 +01:00
Kai Lueke 23115eeaf1 sysext: Skip refresh if no changes are found
When the extensions for the final system are already set up from the
initrd we should avoid disrupting the boot process with the remount
(which currently isn't atomic) and the daemon reload for
systemd-confext and systemd-sysext. Similarly, when sysupdate ran and
updated extensions it's best to avoid the remount and daemon reload if
no changes are found.
To do this, encode the current extension state in more detail than
before where only the names of the extensions where encoded in the
overlay mount. This can also be used to provide more details about the
extension origin in "systemd-sysext status (--json=)". During the
refresh add a check whether the old state matches the new state and in
this case skip the refresh unless the user provides a flag to always
refresh. Besides the extension name and the resolved path the best
method for identification is the verity hash but that is not available
for plain image files or directories. Therefore, also include data to
check for file/directory replacements. The creation/modification times
are not always real on reproducible images or extracted archive content.
The file handle together with the unique mount ID is the next best
identifier we can use when we have no verity hash. Fall back to an inode
when we get no handle. With the creation/modification time and the path
this should be good enough. Using a unique mount ID is important (with
a fallback to the regular non-unique mount ID) instead of st_dev because
st_dev gets reused too easily, e.g., by a loop device mount and the
mount ID helps to catch this. For the mount ID to be valid it has to be
resolved before we enter the new mount namespace. Thus, it gets provided
by the image dissect logic and handed over to the sysext subprocess
which runs in a new mount namespace.
Luckily, we can rule out online modification of directories or image
files because this is anyway not well supported with overlay mounts, so
we don't do a file checksum nor do we recurse into a directory to look
for the most recently touched files.  But, as said, with the
always-refresh flag one can force a reload.
2026-02-04 00:05:24 +01:00
Michael Vogt 6e67fc2938 vmspawn: add --ephemeral option similar to nspawn
This patch adds a `--ephemeral` option to vmspawn that will turn
on snapshot mode on the qemu disk passed via `--image` or the
directory passed via `--directory`. For disk images it uses the
native mechanism that qemu provides. For directories it (re)uses
the snapshot mechanism that nspawn is using, i.e. it will create
a btrfs snapshot if possible and if not falls back to a traditional
directory copy.
2026-02-03 20:22:14 +01:00
Graham Reed 93c0e032b0 man: OnSuccessJobMode= default is fail (#40509)
For the feature added in 294446dcb9,
with OnSuccessJobMode= added to the docs in
e87abe8206.
2026-01-31 01:18:46 +09:00
Vitaly Kuznetsov 307785960b repart: Restore early generation of fstab/crypttab
Commit 15b1c33 ("repart: Generate fstab and crypttab late") moved
fstab/crypttab generation to the late stage but this introduced a regression:
it may be necessary to include fstab and crypttab into the generated partition
(e.g. with CopyFiles=). This is incompatible with 'fixate-volume-key' option as
it is impossible to capture LUKS volume key before it gets created but all the
rest should work fine.

Generate crypttab twice: early and late to capture possible changes. There's no
need to do the same for fstab for now, so keep the status quo.
2026-01-30 13:21:57 +01:00
Kai Lüke 16b3472b3f vmspawn: Add image format option to support qcow2
A QEMU qcow2 VM image can be internally sparse and compressed.
Support such images in vmspawn for both the main disk and any extra
disks.
2026-01-29 09:02:13 +09:00
Mike Yuan cc7fe807c1 ansi-color: $SYSTEMD_COLORS=true should mean generic "auto", not 24bit
Follow-up for af718e0535

The commit changed the documentation, but the actual impl
was apparently not updated. And the documented behavior
feels a bit off. I think generally "auto"/true should
override $NO_COLOR.

Plus, the test for auto-24bit is at odds with the logic
we merged. I guess it was overlooked after applying
https://github.com/systemd/systemd/pull/40303#discussion_r2720450393
2026-01-27 19:20:30 +01:00
Daniel Foster 49811c6715 man/custom-html: support dark mode
Use the browser's default style and opt in for dark mode.

Has the bonus of removing some
[deprecated attributes](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/body#deprecated_attributes).
2026-01-27 13:43:33 +01:00
Peter Oliver af718e0535 ansi-color: new option SYSTEMD_COLORS=auto-16/auto-256/auto-24bit (#40303)
Setting SYSTEMD_COLORS=auto-16 is like SYSTEMD_COLORS=16 if output is to
a non-dumb TTY, and like SYSTEMD_COLORS=no otherwise.

Relates to
https://github.com/systemd/systemd/issues/15498#issuecomment-1682025186
2026-01-23 13:54:31 +01:00
Antonio Alvarez Feijoo 236033fd48 man/fstab-generator: correct root= options
Remove duplicate "fstab" option, and add missing "tmpfs" and "bind:" options.
2026-01-23 13:29:31 +01:00
Lennart Poettering 955446d2e4 hostnamed: expose fancy OS name as a field 2026-01-21 21:32:49 +01:00
Lennart Poettering a01cd5bed3 man: introduce FANCY_NAME field 2026-01-21 21:32:49 +01:00
Daan De Meyer 824fcb95c9 portable: Enable unpriv operation
This does not yet support directory images properly
as systemd itself does not support unpriv directory
images properly yet.

The user profiles are a copy of the system profiles but without
DynamicUser=yes (can't be used by user managers) and without
ProtectHome=yes (this masks /home which breaks StateDirectory= which
is lcoated inside /home)
2026-01-21 15:09:46 +01:00
Lennart Poettering d0badc0a61 sysupdate: add simple "freshness" validation to systemd-sysupdate
In order to make "freeze" attacks against the update logic harder let's
add the ability to encode a "Best Before" date into SHA256SUMS directory
listings: if the current time is already beyond that time, we'll ignore
the SHA256SUMS as "stale" and fail the upgrade. Or in other words: the
freeze attack will now result in a client-side error eventually, instead
of success state.

The best before data is encoded in an optional pseudo-file listed in SHA256SUMS:
any file named BEST-BEFORE-YYYY-MM-DD.
2026-01-20 21:22:35 +01:00
Lennart Poettering 9316e02c9d Introduce 'fixate-volume-key' option to repart/cryptsetup to pin the exact LUKS volume key hash (#40343)
Add an option to generate the expected volume key hash for LUKS volumes
by systemd-repart
and put it to crypttab, make systemd-cryptsetup check it upon attaching.
The format of the hash
matches what's currently being measured to TPM2 PCR with
tpm2-measure-pcr=.

Closes #40123
2026-01-19 21:59:47 +01:00
Vitaly Kuznetsov 4754289ddf repart: Add fixate_volume_key crypttab option generation
Add an option to capture the expected LUKS volume key hash and
record it to the generated crypttab.
2026-01-19 17:50:25 +01:00
Vitaly Kuznetsov 69fab29ec4 cryptsetup: Add fixate-volume-key option to pin the expected volume key hash
The expected hash (SHA265 HMAC signature) uses the exact same algorithm which
is used to calculate sha256 PCR bank digest when 'tpm2-measure-pcr=' is used.
2026-01-19 17:49:39 +01:00
Luca Boccassi d059615492 portable: pin attached image via image-policy
When attaching images generate a policy in the portable drop-in
that matches the partition types and content found while dissecting,
so that it can no longer be changed later without a reattach.
2026-01-19 15:54:12 +01:00
Yu Watanabe 67040ea2bc More legacy kernel support removal; follow-ups for XAT_FDROOT (#40384) 2026-01-19 23:10:17 +09:00
zefr0x 985a6fa44b busctl: handle --limit-messages option under the wait verb
Main focus was to not introduce breaking change or duplicated argument.
The `--limit-messages=` option that is used under the `monitor` verb is
reused here. However, both `wait` and `monitor` have contradicting
default behaviors, so it's not the cleanest thing to do.

There was some post-commit discussion about the API in #33961, but the
final name adopted in #34928 wasn't that flexible either to fit nicely
here in the `wait` verbe.

Additionally, there wasn't consideration in #34555 for having uniform
behavrious, so we ended with `wait` verb and `--limit-messages=` option,
rather than `receive` verb with default of continuously receving signals
withtout exit so `--limit-messages=` make more sence and be expectable.
2026-01-19 22:41:33 +09:00
Mike Yuan 1a0df07843 core/cgroup: obsolete DefaultMemoryMin/Low=
Now that our kernel baseline is v5.7 and memory_recursiveprot
is universally enabled, remove userspace workarounds.
2026-01-19 13:33:28 +01:00
Mike Yuan 73b82070e1 docs,man: more SysV compat removal notes 2026-01-18 15:50:54 +09:00
Yu Watanabe 4ac445c152 udev/net: support more ethtool features
Closes #39318.
2026-01-17 02:52:20 +09:00
Yu Watanabe d5a7f58d1a Also drop SysV rc.local script support (#40295)
Continuation of #39770.
2026-01-17 02:50:08 +09:00
Luca Boccassi 3e2a5dc2e1 dissect: support mount options when going through mountfsd, requiring privileges via polkit (#39394)
RootImageOptions=/ExtensionImages=/MountImages= all support custom
mount options, but mountfsd does not support it. Add varlink
parameters to allow callers to specify mount options so that
those directives can work as expected. Require additional privs via
polkit.
2026-01-16 14:55:02 +00:00
Yu Watanabe d207be293c Drop support for SysV rc-local script support
As already announced for several years.
2026-01-16 22:56:28 +09:00
Yu Watanabe 0a2cdd5891 Drop remaining references about sysv script support
Follow-up for 986fee6217.
2026-01-16 22:56:08 +09:00
Michael Vogt 3f958812fd sd-boot: allow setting the timeout via SMBIOS 11
Allow configuring the menu timeout used by sd-boot by setting
`io.systemd.boot.timeout=<value>` as SMBIOS type 11 string.

This takes precedence over the setting from the config file
and the EFI var.

Useful for e.g. integration tests that want to control that
a generic image boots faster.
2026-01-16 10:26:48 +01:00
Zbigniew Jędrzejewski-Szmek 311fddcd8d man/systemd.service: Expand docs on RestartSteps (#40309) 2026-01-15 11:41:17 +01:00
Michael Vogt b6eabd21ea man: fix copy/paste issue in systemd-vmspawn.xml
The systemd-vmspawn man page has a note that the `--notify-ready`
defaults to "true" and then says that this is unlike "systemd-vmspawn"
where it defaults to "false". This appears to be a copy/paste issue
and here we want "unlike systemd-nspawn".
2026-01-14 17:15:20 +09:00
Christian Hesse d1bd940deb man: drop duplicate "the" 2026-01-14 10:14:31 +09:00
Yu Watanabe 716246f235 man: fix indentation 2026-01-12 18:33:58 +09:00
Matthijs Kooijman af88aa17c7 man/systemd.service: Note RestartSteps only works with RestartSec= set
Setting Restart=0 seems reasonable to have no delay on the first
restart, if you do not realize this is impossible with an exponential
restart. So explicitly mention that RestartSec must be set.
2026-01-08 23:46:05 +01:00
Matthijs Kooijman 2102511f4a man/systemd.service: Note RestartSteps are exponential 2026-01-08 23:34:03 +01:00
Yu Watanabe 5366dbdbd4 core: fix typo
Follow-up for 32614b9aab.
2026-01-08 12:20:22 +09:00
Luca Boccassi 3a8759e5d4 dissect: support mount options when going through mountfsd
RootImageOptions=/ExtensionImages=/MountImages= all support
custom mount options, use the new mountfsd parameters to
configure them if they are specified.

This requires additioanl privileges via polkit due to security
implications of mount options, so document an example policy
that allows to use the nosuid mount option.
2026-01-07 00:47:53 +01:00
Yu Watanabe 3ff23e8c4b man: do not manually update man/rules/meson.build
Follow-up for 25393c7c90.
2026-01-06 22:50:47 +01:00
Yu Watanabe 17ea504efb core: change mount options settings so that last defined wins (#39449) 2026-01-07 04:11:29 +09:00
Yu Watanabe a6d553c4f4 Drop support for sysvinit scripts (#39770)
As announced by a few releases now, finally drop support for sysvinit scripts.
2026-01-07 02:51:53 +09:00
Luca Boccassi 9de41f677c core: change mount options settings so that last defined wins
Currently mount options are handled in such a way that the first
definition for a given partition wins, and documented as such.
Change them so that they behave like other options, and the
last specified wins.
Applies to RootImageOptions=, MountImages= and ExtensionImages=.
Switch from a linked list to an array indexed by the partition
specifier to store them.
2026-01-06 17:59:10 +01:00
Usama Arif 32614b9aab core: introduce MemoryTHP= unit file setting
Transparent Hugepages (THP) is a Linux kernel feature that manages
memory using larger pages (2MB on x86, compared to the default 4KB).
The main goal is to improve memory management efficiency and system
performance, especially for memory-intensive applications.
However, it can cause drawbacks in some scenarios, such as memory
regression and latency spikes. THP policy is governed for the entire
system via /sys/kernel/mm/transparent_hugepage/enabled.
However, it can be overridden for individual workloads via prctl(2)
call.
MemoryTHP= is used to disable THPs at exec-invoke to stop
providing THPs for workloads where the drawbacks outweigh the advantages.
When set to "disable", MemoryTHP= disables THPs completely for the
process, irrespecitive of global THP controls.
When set to "madvise", MemoryTHP= disables THPs for the process except
when specifically madvised by the process with MADV_HUGEPAGE or MADV_COLLAPSE.
2026-01-06 03:26:14 -08:00