[systemd-devel] emergency mode vs rescue mode

Lennart Poettering lennart at poettering.net
Wed Feb 3 13:58:26 PST 2016


On Wed, 03.02.16 22:03, Michael Biebl (mbiebl at gmail.com) wrote:

> Hi everyone
> 
> I wonder that emergency.target/emergency.service/emergency mode is good for.
> 
> Afaics, it doesn't offer anything that rescue mode doesn't also offer.
> I find this situation a bit confusing.
> 
> Can anyone enlighten me why we need two different modes which are
> basically the same?

Emergency mode means the only running process is a shell, besides
systemd itself.

rescue mode means all early-boot services have been started, all
mounts have been established, and then gives you a shell.

emergency mode is a bit like booting with init=/bin/sh except that you
actually have systemd up properly, and can start services bit-by-bit
if you like. emergency mode is also entered if fsck fails, as in that
case rescue mode is unachievable, as we cannot mount the failed
disks...

rescue mode is usually what admins want to boot into for single-user
maintainance tasks. The only reason when you want to boot into
emergency mode instead if you have some fuckup with your disks.

Note that sysvinit had the very same distinction, though the feature
is little-known. Booting sysvinit with "emergency" on the kernel
cmdline would give you just sysvinit as PID1 plus /bin/sh forked
off. Booting sysvinit with "1" on the kernel cmdline would give you
runlevel 1 services including mounts, and then a shell. In fact,
systemd understand the same kernel cmdline keywords and does the right
thing...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list