Systemd: how to get into rescue mode

Tom H tomh0665 at gmail.com
Sat Jan 11 02:36:42 UTC 2020


On Fri, Jan 10, 2020 at 11:13 PM Little Girl <littlergirl at gmail.com> wrote:
> Volker Wysk wrote:
>
>> This works! I've tried it with "systemctl isolate multi-user.target",
>> and then "systemctl isolate rescue.target". But, when you afterwards
>> type ctrl-D or "exit", it stands still with the ubuntu symbol, with
>> the dots under the "ubuntu" lettering. It's the same with typing
>> "systemctl isolate default.target" instead. So you have to do a
>> reboot.
>
> This page gives a quick overview of (now obsolete) runlevels and
> suggests that the telinit command used to be used to change runlevels
> in a running system:
>
> https://www.tldp.org/LDP/sag/html/run-levels-intro.html
>
> The telinit man page shows that "telinit may be used to change the
> SysV system runlevel. Since the concept of SysV runlevels is obsolete
> the runlevel requests will be transparently translated into systemd
> unit activation requests."
>
> As a result, once you're in a Systemd target, you should be able to
> type telinit 0 (that's telinit followed by a zero) to shut down the
> computer for a hard reset or telinit 6 to reboot the computer.

"telinit" is a sysvinit command but the "systemd-sysv" package
provides it as a symlink to systemctl just like other executables that
are provided/needed by sysvinit (except for "init" which is symlinked
to systemd of course!)

$ file $(dpkg -L systemd-sysv | g sbin/ | sort)
/sbin/halt:     symbolic link to /bin/systemctl
/sbin/init:     symbolic link to /lib/systemd/systemd
/sbin/poweroff: symbolic link to /bin/systemctl
/sbin/reboot:   symbolic link to /bin/systemctl
/sbin/runlevel: symbolic link to /bin/systemctl
/sbin/shutdown: symbolic link to /bin/systemctl
/sbin/telinit:  symbolic link to /bin/systemctl




More information about the ubuntu-users mailing list