1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00

1762 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
29832663dc meson: drop remaining target names
Most of those were dropped in 7d247d3cb8. I left
behind the few cases where the 'output' name was different from the target name.
But we actually don't need those either, so get rid of those. (And one case
where I missed the name argument.)

No functional change, except that e.g. 'ninja -C build update-man-rules-impl'
doesn't work, but I hope nobody was using that.
2025-10-04 18:13:27 +02:00
Mike Yuan
e8d5badc5f units/systemd-battery-check.service: split [Unit] options into groups 2025-09-30 16:34:54 +02:00
Mike Yuan
997717e274 units/systemd-battery-check.service: prettify Description=
Addresses https://github.com/systemd/systemd/pull/39170#issuecomment-3348997894
2025-09-30 16:34:44 +02:00
Yu Watanabe
2c883d7591 units: move FailureAction= to the correct section
FailureAction= in [Service] is still supported but deprecated.

Follow-up for e3d4148d50.
2025-09-29 22:47:24 +02:00
Lennart Poettering
aa27bec194 firstboot: optionally, don't query for keymap unless connected to a real VT
The keymap only really matters if there's local access to a system, i.e.
if there's actually a physical kbd directly connected to it, to apply it
to. If during firstboot we are not talked to via a VT (but via SSH,
container, or hypervisor console or so instead), then it's very unlikely
we ever are. Hence, don't ask for a keymap, and let#s shortcut the
questions asked at boot.
2025-09-26 16:40:14 +02:00
Lennart Poettering
0cfaea3619 homectl: mute console while running firstboot prompts 2025-09-26 16:19:43 +02:00
Lennart Poettering
6d40d0773c homectl: make querying for shell+aux groups optional in firstboot mode 2025-09-26 16:19:43 +02:00
Lennart Poettering
0d2cc656c8 firstboot: mute console while running on the console at boot
Fixes: #34448
2025-09-26 09:42:13 +02:00
Lennart Poettering
ac63a04bd6 mute-console: add simple varlink service that can disable log/status spew to kernel console
For "wizard" style interactive tools it's very annoying if they are
interrupted by kernel log output or PID1's status output. let's add some
infra to disable this temporarily. I decided to implement this as an IPC
service so that we can make this robust: if the client request the
muting dies we can automatically unmute again.

This is hence a tiny varlink service, but it can also be started
directly from the cmdline.
2025-09-26 09:42:13 +02:00
Lennart Poettering
f5fa86f9f8 machined: allow running in --user mode 2025-09-25 22:43:59 +02:00
Lennart Poettering
d7b966ad13 firstboot: don't call this thing a "wizard"
It isn't really, it's an initial setup tool, which is what GNOME calls
their equivalent too.
2025-09-24 15:46:30 +02:00
Lennart Poettering
19f2baccce repart: add basic Varlink support, for now only with a ListCandidateDevices() call 2025-09-23 09:22:04 +02:00
Luca Boccassi
defa0148b8 units: add missing Documentation=
The initrd units are described in the graphs in the bootup manpage,
so use that one for them.
2025-09-18 21:54:36 +01:00
Lennart Poettering
818bd1dfa1 mountfsd: uncomment CapabilityBoundingSet= line
Since mountfsd was added in 702a52f4b5 the
caps bounding set line was commented. That's an accident. Fix that. (We
need to add a bunch of caps to the list).
2025-09-18 21:30:51 +02:00
Lennart Poettering
1c9500c2b7 units: explicitly reset TTY before running stuff on console
This adds TTYReset=yes to all units which run directly on the TTY. We
already had this in place for the gettys, but this adds it for the rest
that basically has StandardInput=tty + StandardOutput=tty set.

Originally, for these tools it wasn't necessary to reset the TTY,
because we after all already reset /dev/console very very early on once,
during PID1's early initialization, and hence there's no real reason to
do it again for these early boot services. But that's actually not
right, because since #36666 the TTY we reset from PID 1 is typically
/dev/console but the TTY those services are invoked on is typically the
resolved version of that, i.e. wherever that points. Now you might
think: if one is just an alias to the other, why does it matter to reset
this again? Well, because it's only a half-assed alias, and as it turns
out WIOCSWINSZ is not propagated from one to the other, i.e the terminal
dimesions we initialize for /dev/console don't propagate to whatever
that points to.

One option to address that would be to immediately propagate this down
ourselves (or to fix the kernel for it), but it felt safer to simply do
the reset again before the use, after all these one one-off services,
and there's no point in optimizing much here. Moreover, its probably
safer to give the guarantee that when the firstboot stuff (which after
all queries for pws to set) runs it definitely certainly guaranteed has
a properly reset terminal.
2025-09-18 21:30:31 +02:00
nl6720
8ec3e769b5 systemd-boot-update.service: replace --no-variables with --variables=no
bbeeea4362 replaced the option in bootctl,
so systemd-boot-update.service should follow.
2025-09-18 17:00:49 +03:00
Franck Bui
204c34040a units: don't force the loading of the loop and dm_mod modules in systemd-repart.service
This avoids loading the aforementioned modules when systemd-repart is skipped
during the boot process, which is the case most of the time.
2025-09-18 08:46:34 +09:00
Zbigniew Jędrzejewski-Szmek
28021f6e88 Some post unmerged-usr cleanups (#38696)
I noticed in our NixOS packaging that we were working around the fact
that core/swap.c looks for swapon and swapoff in /sbin

Lets make it configurable just like all the other util-linux binaries
through meson and make it default to /usr/sbin/{swapon,swapoff}

This way mounts work on a systemd without the /sbin -> /usr/sbin
compatibility symlink. (And as a side-effect has NixOS be able to have
it in /nix/store too like the other util-linux tools).

Given that `unmerged-usr` support was dropped in 255 I think this is a
safe change?
2025-09-17 14:22:05 +02:00
Yu Watanabe
8c0cad97c7 units: portabled requires /dev/loop-control
Fixes #38692.
2025-08-29 14:49:26 +09:00
Arian van Putten
fa7e3a96e4 units/*getty*: use /usr/sbin/agetty
Same way that we do it for quotaon and debug-shell by
going through meson
2025-08-24 14:01:21 +02:00
Michal Sekletar
fb56da5b6e coredump: drop RestrictSUIDSGID= option (#38640)
systemd-coredump sandbox already has ProtectSystem=strict hence all non
API filesystems are made read-only, thus RestrictSUIDSGID= doesn't buy
us much.

On top of that systemd-coredump's EnterNamespace= feature requires
openat2() to work correctly and that is implicitly blocked by
RestrictSUIDSGID=.

Follow-up for 8f8148cb08
2025-08-20 11:42:30 +01:00
Mike Yuan
8c7dfa0ff4 units/ssh-access.target: enable StopWhenUnneeded=
This combines nicely with the X_SYSTEMD_UNIT_INACTIVE= notification
we send out, to ensure when all sshd units go down the actual
status is always reflected on the target.
2025-07-22 15:01:26 +01:00
Yu Watanabe
dba4fe9a60 quotacheck: add quotacheck.mode credential support 2025-07-16 05:47:38 +09:00
Yu Watanabe
fff4dcc6de man: fix reference to systemd-quotacheck@.service
Also this makes the man page mentions systemd-quotacheck-root.service.
2025-07-16 05:47:38 +09:00
Yu Watanabe
059afcadfd fsck: add fsck.mode and fsck.repair credentials support
Maybe useful when kernel command line is hard to change, e.g. when UKI
is used.
2025-07-16 05:47:38 +09:00
Yu Watanabe
e58ba80a40 units: drop runlevel[0-6].target 2025-07-13 05:49:09 +09:00
Yu Watanabe
dc1505555b utmp: drop setting runlevel entry in utmp
This removes systemd-update-utmp-runlevel.service and related command.
2025-07-13 05:49:00 +09:00
Yu Watanabe
8ba48d4bf8 core,initctl,systemctl: kill /dev/initctl support
This also kills support for controlling system state through
/sbin/init, initctl, and telinit.
2025-07-13 05:38:14 +09:00
Yu Watanabe
7c208a64ba units: check if kmod command exists
We already check existences of quotaon in quotaon@.service and
quotacheck in systemd-quotacheck@.service.
Let's also check if kmod command exists.

Closes #38179.
2025-07-12 07:18:17 +02:00
Mike Yuan
f22187bd7e units/machines.target: fix typo
Follow-up for 48cb009afc
2025-07-11 21:38:58 +02:00
Lennart Poettering
b2f23bd2b1 Support global sysext/confext in systemd-stub/systemd-sysext (#38113)
Systemd-stub supports loading addons, credentials, system and
configuration
extensions from ESP and while addons and credentials can be both global
and
per-UKI, sysext/confext are only per-UKI. 

Add support for global sysext/confext to systemd-stub/systemd-sysext.

Fixes #37993
2025-07-11 21:10:51 +02:00
Lennart Poettering
3405b84d8c units: systems might take a while to boot
vmspawn systems might take quite a while to boot in particular if they
go through uefi and wait for a network lease. Hence let's increase the
start timeout to 2min (from 45s). We'll do that for both nspawn and
vmspawn, even though the UEFI thing certainly doesn't apply there (but
the DHCP thing still does).
2025-07-11 18:17:04 +02:00
Lennart Poettering
48cb009afc units: add units for vmspawn/nspawn in --user mode too 2025-07-11 18:17:04 +02:00
Vitaly Kuznetsov
8d07a8d6b1 sysext: Support global sysext/confext
Load global sysext/confext from /.extra/global_{sysext,confext} which
systemd-stub puts there from ESP/loader/credentials/*.{sysext,confext}.raw.
Global extensions are handled the exact same way as per-UKI ones.
2025-07-11 13:08:26 +02:00
Ubuntu
df5b3426f6 journald: support reloading configuration at runtime 2025-07-10 21:38:36 +02:00
DaanDeMeyer
cc43510a13 userdb: Add userdb.transient credentials
To implement --bind-user in systemd-vmspawn, we need a transient
version of these credentials. These are useful when the home directory
of the user is mounted into the container/vm and every trace of the user
will be (mostly) gone again when the container/vm is shut down.
2025-07-10 21:36:09 +02:00
Yu Watanabe
1cf5b39d64 core: add 'DefaultRestrictSUIDSGID' config option (#38126)
closes #37602, see there for extra motivation and considered
alternatives.

On typical systems, only few services need to create SUID/SGID files.
This often is limited to the user explicitly setting suid/sgid, the
`systemd-tmpfiles*` services, and the package manager. Allowing a
default to globally restrict creation of suid/sgid files makes it easier
to apply this restriction precisely.

## testing done
- built on aarch64-linux and x86_64-linux
- ran a VM test on x86_64-linux, checking for:
    - VM system boots successfully
    - defaults apply (both `yes`, `no`, and undefined)
    - systemd tmpfiles can set suid/sgid on journal log path
- Other services explicitly defining `RestrictSUIDSGID=no` can create
suid files
2025-07-10 13:30:07 +09:00
Grimmauld
fd3b207011 units/systemd-tmpfiles-setup.service: explicitly set RestrictSUIDSGID=no
The tmpfiles service is used to set file permissions, e.g. for setting
suid bit on the journal log directory [1].

[1] 48e0f7bc2f/tmpfiles.d/systemd.conf.in (L24-L25)
2025-07-09 11:08:31 +02:00
Fabian Vogt
e21cd6db9c units/initrd-cleanup.service: Conflict with emergency.target
This is very similar to 327cd2d3db:

If emergency.target is started while initrd-cleanup.service/start is queued,
the initrd-cleanup job did not get canceled. In parallel to the emergency
units, it eventually runs the service, which in turn isolates and starts
initrd-switch-root.target. This stops the emergency units and effectively
starts the initrd boot process again, which likely fails again like the
initial attempt. The system is thus stuck in a loop, never really reaching
emergency.target.

This can be triggered if a service in between initrd-parse-etc.service
and initrd.target fails.

With this conflict added, starting emergency.target automatically cancels
initrd-cleanup.service/start, avoiding the loop.
2025-07-09 10:28:29 +02:00
Lennart Poettering
0fa3ac436c ssh-generator: generate /etc/issue.d/ with VSOCK ssh info data (#37819)
ssh-generator: generate /etc/issue.d/ with VSOCK ssh info data
    
I find myself trying to log into a fresh ParticleOS VM started via
systemd-vmspawn all the time, but I don't know its CID. Let's show it on
the getty screen, to make it immediately visible.
2025-07-04 10:45:45 +02:00
Lennart Poettering
864a5e9ded getty: support /run/issue.d/
By default agetty will not display /run/issue.d/ if /etc/issue exists.
This is quite unfortunate and has actually been fixed upstream in:

508fb0e7ac

However, no release has been tagged with this yet, and it doesn't look
like this will happen any time soon. Hence, for now, let's add a
work-around and manually override the issue files to include.

This should be reverted once a new util-linux/agetty release has been
tagged, and found its way into the relevant distributions. Given this is
mostly about cosmetics we do not have to precisely sync the package
updates on this, but only roughly.
2025-07-03 16:46:28 +02:00
Daan De Meyer
0470754f9d login: Add varlink socket unit 2025-07-03 11:22:34 +02:00
Daan De Meyer
b0ea79c5b5 network: Add varlink socket unit 2025-07-03 11:22:34 +02:00
Mike Yuan
a2b34106e7 units/systemd-{udevd,journald}*.socket: enable DeferTrigger=
Refer to d766c75acd for the rationale
behind the udevd change.

systemd-journald.service conflicts with soft-reboot.target,
so make sure anything surviving soft-reboot and trying
to log to journal doesn't fail the socket units.
2025-06-30 13:10:43 +02:00
Mike Yuan
286c61732f units/initrd-cleanup.service: drop --job-mode=replace-irreversibly hack
This partially reverts d766c75acd.

The offending commit tries to block systemd-udevd.service
from being activated during switch-root, but it is a dirty hack
and causes problems with e.g. Ctrl-Alt-Delete handling which
actually need to start a conflicting target. Let's revert
this here, and the original issue will be resolved in a cleaner
fashion in later commits.
2025-06-30 13:10:28 +02:00
Zbigniew Jędrzejewski-Szmek
7d247d3cb8 meson: drop explicit custom_target names
[1] says:
> Since 0.60.0 the name argument is optional and defaults to the basename of
> the first output
We specify >= 0.62 as the supported version, so drop the duplicate name in all cases
where it is the same as outputs[0], i.e. almost all cases.

[1] https://mesonbuild.com/Reference-manual_functions.html#custom_target
2025-06-28 17:14:50 +02:00
Mike Yuan
85352c095e various: turn off SO_PASSRIGHTS where fds are not expected 2025-06-17 13:16:44 +02:00
Mike Yuan
9453a92ad7 units/systemd-journald@.socket: enable SO_TIMESTAMP
Follow-up for 02229dff2b

This applies the change to journal namespace instances too.
2025-06-17 13:16:07 +02:00
Lennart Poettering
008818ec96 units: make sure the network tap driver is actually loaded
We have the After= line, but not the Wants= line. Fix that.
2025-06-14 13:29:14 +09:00
Lennart Poettering
273d14f5dd nsresourced: make sure "tun" driver is properly loaded and accessible
We need access to /dev/net/tun, hence make sure we can actually see
/dev/. Also make sure the module is properly loaded before we operate,
given that we run with limit caps. But then again give the CAP_NET_ADMIN
cap, since we need to configure the network tap/tun devices.

Follow-up for: 1365034727
2025-06-14 00:59:37 +02:00