[systemd-devel] Why is my reboot.target disabled?
Andrei Borzenkov
arvidjaar at gmail.com
Tue Jul 4 15:23:43 UTC 2023
On 04.07.2023 14:58, Ferenc Wágner wrote:
> Hi,
>
> Please help me understand this phenomenon (systemd 252):
>
> $ systemctl status ctrl-alt-del.target
> ○ reboot.target - System Reboot
> Loaded: loaded (/lib/systemd/system/reboot.target; disabled; preset: enabled)
> Active: inactive (dead)
> Docs: man:systemd.special(7)
>
> $ ls -l /{etc,run}/systemd/system | fgrep reboot
>
> $ ls -l /lib/systemd/system | fgrep reboot
> lrwxrwxrwx 1 root root 13 febr 28 12.15 ctrl-alt-del.target -> reboot.target
> -rw-r--r-- 1 root root 443 febr 1 18.20 plymouth-reboot.service
> -rw-r--r-- 1 root root 598 febr 16 19.10 reboot.target
> drwxr-xr-x 2 root root 4096 ápr 22 22.15 reboot.target.wants
> lrwxrwxrwx 1 root root 13 febr 28 12.15 runlevel6.target -> reboot.target
> -rw-r--r-- 1 root root 568 febr 16 19.10 systemd-reboot.service
>
> What does it mean that reboot.target is disabled?
It means links listed in [Install] section are not present.
> And why is it?
>
Probably because those presets were never actually applied. Presets were
intended to be used to perform initial configuration "on the first
boot", but it does not make them mandatory.
> # systemctl enable reboot.target
> Created symlink /etc/systemd/system/ctrl-alt-del.target → /lib/systemd/system/reboot.target.
>
> Now reboot.target is reported as enabled.
>
> # systemctl disable reboot.target
> Removed "/etc/systemd/system/ctrl-alt-del.target".
>
> Now reboot.target is reported as disabled again. Why doesn't the
> ctrl-alt-del.target symlink under /lib/systemd/system count?
>
> Maybe related: why does 90-systemd.preset enable reboot.target but
> disable poweroff.target (for example)?
There can be just one link target for ctrl-alt-del and reboot is the
most logical one.
More information about the systemd-devel
mailing list