Discussion:
[systemd-devel] emergency, rescue and single-user
Jan Synáček
2014-12-09 12:43:16 UTC
Permalink
Hello,

what is the difference between emergency, rescue and single-user?
On F21, systemd-216-12.fc21.x86_64, they all boot into something that
presents itself as "Welcome to emergency mode!" and they all require a
root password. In case of booting into emergency.target, I can see
"Starting Emergency Shell" in the console output. In single-user and
rescue.target, I can see "Starting Rescue Shell", but they all look the
same. systemd.special(7) doesn't help much.

Cheers,
--
Jan Synacek
Software Engineer, Red Hat
Mantas Mikulėnas
2014-12-09 12:55:15 UTC
Permalink
Post by Jan Synáček
Hello,
what is the difference between emergency, rescue and single-user?
On F21, systemd-216-12.fc21.x86_64, they all boot into something that
presents itself as "Welcome to emergency mode!" and they all require a
root password. In case of booting into emergency.target, I can see
"Starting Emergency Shell" in the console output. In single-user and
rescue.target, I can see "Starting Rescue Shell", but they all look the
same. systemd.special(7) doesn't help much.
rescue.target pulls in sysinit.target (mounts, swaps, udev, sysctl...),
while emergency.target starts a sulogin shell and nothing more. See the
graph in bootup(7).

The sysv "single-user mode" maps directly to rescue.target.
--
Mantas Mikulėnas <***@gmail.com>
Jan Synacek
2014-12-10 06:46:41 UTC
Permalink
Post by Mantas Mikulėnas
Post by Jan Synáček
Hello,
what is the difference between emergency, rescue and single-user?
On F21, systemd-216-12.fc21.x86_64, they all boot into something that
presents itself as "Welcome to emergency mode!" and they all require a
root password. In case of booting into emergency.target, I can see
"Starting Emergency Shell" in the console output. In single-user and
rescue.target, I can see "Starting Rescue Shell", but they all look the
same. systemd.special(7) doesn't help much.
rescue.target pulls in sysinit.target (mounts, swaps, udev, sysctl...),
while emergency.target starts a sulogin shell and nothing more. See the
graph in bootup(7).
Ok, good to know about bootup(7), thanks!
--
Jan Synacek
Software Engineer, Red Hat
Lennart Poettering
2014-12-09 13:06:00 UTC
Permalink
Post by Jan Synáček
Hello,
what is the difference between emergency, rescue and single-user?
On F21, systemd-216-12.fc21.x86_64, they all boot into something that
presents itself as "Welcome to emergency mode!" and they all require a
root password. In case of booting into emergency.target, I can see
"Starting Emergency Shell" in the console output. In single-user and
rescue.target, I can see "Starting Rescue Shell", but they all look the
same. systemd.special(7) doesn't help much.
"rescue" is simply how we call the old sysv "single user" mode. This
means all early-boot services are started, but no later boot
service. File systems are hence checked, udev is started, and so
on. You get your shell right after sysinit.target but before
basic.target basically.

"emergency" maps to the "emergency" mode that sysvinit already knew:
it just starts a shell, and does nothing else. No early-boot services
are run. No udev, no file system checks, no nothing.

Lennart
--
Lennart Poettering, Red Hat
Jan Synacek
2014-12-10 06:45:55 UTC
Permalink
Post by Lennart Poettering
Post by Jan Synáček
Hello,
what is the difference between emergency, rescue and single-user?
On F21, systemd-216-12.fc21.x86_64, they all boot into something that
presents itself as "Welcome to emergency mode!" and they all require a
root password. In case of booting into emergency.target, I can see
"Starting Emergency Shell" in the console output. In single-user and
rescue.target, I can see "Starting Rescue Shell", but they all look the
same. systemd.special(7) doesn't help much.
"rescue" is simply how we call the old sysv "single user" mode. This
means all early-boot services are started, but no later boot
service. File systems are hence checked, udev is started, and so
on. You get your shell right after sysinit.target but before
basic.target basically.
it just starts a shell, and does nothing else. No early-boot services
are run. No udev, no file system checks, no nothing.
Lennart
Thanks for the explanation!
--
Jan Synacek
Software Engineer, Red Hat
Continue reading on narkive:
Loading...