mirror of
https://github.com/systemd/systemd
synced 2024-07-09 04:26:06 +00:00
units: introduce emergency.target
This commit is contained in:
parent
2edd4434e5
commit
f057408c9c
10
Makefile.am
10
Makefile.am
|
@ -113,6 +113,7 @@ dbusinterface_DATA = \
|
||||||
|
|
||||||
dist_systemunit_DATA = \
|
dist_systemunit_DATA = \
|
||||||
units/emergency.service \
|
units/emergency.service \
|
||||||
|
units/emergency.target \
|
||||||
units/basic.target \
|
units/basic.target \
|
||||||
units/getty.target \
|
units/getty.target \
|
||||||
units/halt.target \
|
units/halt.target \
|
||||||
|
@ -183,7 +184,8 @@ dist_systemunit_DATA += \
|
||||||
units/fedora/prefdm.service \
|
units/fedora/prefdm.service \
|
||||||
units/fedora/rc-local.service \
|
units/fedora/rc-local.service \
|
||||||
units/fedora/reboot.service \
|
units/fedora/reboot.service \
|
||||||
units/fedora/sysinit.service
|
units/fedora/sysinit.service \
|
||||||
|
units/fedora/single.service
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if TARGET_SUSE
|
if TARGET_SUSE
|
||||||
|
@ -755,7 +757,8 @@ install-data-hook:
|
||||||
$(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
|
$(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
|
||||||
if TARGET_FEDORA
|
if TARGET_FEDORA
|
||||||
$(MKDIR_P) -m 0755 \
|
$(MKDIR_P) -m 0755 \
|
||||||
$(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
|
$(DESTDIR)$(SYSTEM_SYSVINIT_PATH) \
|
||||||
|
$(DESTDIR)$(systemunitdir)/rescue.target.wants
|
||||||
( cd $(DESTDIR)$(pkgsysconfdir)/system && \
|
( cd $(DESTDIR)$(pkgsysconfdir)/system && \
|
||||||
rm -f display-manager.service && \
|
rm -f display-manager.service && \
|
||||||
$(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
|
$(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
|
||||||
|
@ -765,6 +768,9 @@ if TARGET_FEDORA
|
||||||
( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
|
( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
|
||||||
rm -f rc-local.service && \
|
rm -f rc-local.service && \
|
||||||
$(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
|
$(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
|
||||||
|
( cd $(DESTDIR)$(systemunitdir)/rescue.target.wants && \
|
||||||
|
rm -f single.service && \
|
||||||
|
$(LN_S) $(systemunitdir)/single.service single.service )
|
||||||
( cd $(DESTDIR)$(systemunitdir) && \
|
( cd $(DESTDIR)$(systemunitdir) && \
|
||||||
rm -f local.service && \
|
rm -f local.service && \
|
||||||
$(LN_S) rc-local.service local.service )
|
$(LN_S) rc-local.service local.service )
|
||||||
|
|
|
@ -501,7 +501,7 @@
|
||||||
<listitem><para>Enter emergency
|
<listitem><para>Enter emergency
|
||||||
mode. This is mostly equivalent to
|
mode. This is mostly equivalent to
|
||||||
<command>isolate
|
<command>isolate
|
||||||
emergency.service</command> but also
|
emergency.target</command> but also
|
||||||
prints a wall message to all
|
prints a wall message to all
|
||||||
users.</para></listitem>
|
users.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<filename>dbus.target</filename>,
|
<filename>dbus.target</filename>,
|
||||||
<filename>default.target</filename>,
|
<filename>default.target</filename>,
|
||||||
<filename>display-manager.service</filename>,
|
<filename>display-manager.service</filename>,
|
||||||
<filename>emergency.service</filename>,
|
<filename>emergency.target</filename>,
|
||||||
<filename>exit.service</filename>,
|
<filename>exit.service</filename>,
|
||||||
<filename>graphical.target</filename>,
|
<filename>graphical.target</filename>,
|
||||||
<filename>halt.target</filename>,
|
<filename>halt.target</filename>,
|
||||||
|
@ -205,9 +205,9 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><filename>emergency.service</filename></term>
|
<term><filename>emergency.target</filename></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>A special service unit
|
<para>A special target unit
|
||||||
that starts an emergency
|
that starts an emergency
|
||||||
shell on the main
|
shell on the main
|
||||||
console. This unit is supposed
|
console. This unit is supposed
|
||||||
|
|
|
@ -1947,7 +1947,7 @@ static int manager_process_signal_fd(Manager *m) {
|
||||||
static const char * const table[] = {
|
static const char * const table[] = {
|
||||||
[0] = SPECIAL_DEFAULT_TARGET,
|
[0] = SPECIAL_DEFAULT_TARGET,
|
||||||
[1] = SPECIAL_RESCUE_TARGET,
|
[1] = SPECIAL_RESCUE_TARGET,
|
||||||
[2] = SPECIAL_EMERGENCY_SERVICE,
|
[2] = SPECIAL_EMERGENCY_TARGET,
|
||||||
[3] = SPECIAL_HALT_TARGET,
|
[3] = SPECIAL_HALT_TARGET,
|
||||||
[4] = SPECIAL_POWEROFF_TARGET,
|
[4] = SPECIAL_POWEROFF_TARGET,
|
||||||
[5] = SPECIAL_REBOOT_TARGET
|
[5] = SPECIAL_REBOOT_TARGET
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#define SPECIAL_SYSINIT_TARGET "sysinit.target"
|
#define SPECIAL_SYSINIT_TARGET "sysinit.target"
|
||||||
#define SPECIAL_RESCUE_TARGET "rescue.target"
|
#define SPECIAL_RESCUE_TARGET "rescue.target"
|
||||||
#define SPECIAL_EXIT_SERVICE "exit.service"
|
#define SPECIAL_EXIT_SERVICE "exit.service"
|
||||||
#define SPECIAL_EMERGENCY_SERVICE "emergency.service"
|
#define SPECIAL_EMERGENCY_TARGET "emergency.target"
|
||||||
#define SPECIAL_HALT_TARGET "halt.target"
|
#define SPECIAL_HALT_TARGET "halt.target"
|
||||||
#define SPECIAL_POWEROFF_TARGET "poweroff.target"
|
#define SPECIAL_POWEROFF_TARGET "poweroff.target"
|
||||||
#define SPECIAL_REBOOT_TARGET "reboot.target"
|
#define SPECIAL_REBOOT_TARGET "reboot.target"
|
||||||
|
|
|
@ -720,7 +720,7 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
|
||||||
[ACTION_RUNLEVEL4] = SPECIAL_RUNLEVEL4_TARGET,
|
[ACTION_RUNLEVEL4] = SPECIAL_RUNLEVEL4_TARGET,
|
||||||
[ACTION_RUNLEVEL5] = SPECIAL_RUNLEVEL5_TARGET,
|
[ACTION_RUNLEVEL5] = SPECIAL_RUNLEVEL5_TARGET,
|
||||||
[ACTION_RESCUE] = SPECIAL_RESCUE_TARGET,
|
[ACTION_RESCUE] = SPECIAL_RESCUE_TARGET,
|
||||||
[ACTION_EMERGENCY] = SPECIAL_EMERGENCY_SERVICE,
|
[ACTION_EMERGENCY] = SPECIAL_EMERGENCY_TARGET,
|
||||||
[ACTION_DEFAULT] = SPECIAL_DEFAULT_TARGET
|
[ACTION_DEFAULT] = SPECIAL_DEFAULT_TARGET
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,16 +10,17 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Emergency Shell
|
Description=Emergency Shell
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target umount.target
|
After=shutdown.target
|
||||||
After=shutdown.target umount.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
ExecStartPre=-/bin/plymouth --hide-splash
|
||||||
|
ExecStartPre=-/bin/echo 'Welcome to emergency mode. Use "systemctl default" to activate default mode.'
|
||||||
ExecStart=/bin/sh
|
ExecStart=/bin/sh
|
||||||
StandardInput=tty
|
StandardInput=tty-force
|
||||||
Restart=restart-always
|
Restart=restart-always
|
||||||
RestartSec=0
|
RestartSec=0
|
||||||
KillMode=process-group
|
KillMode=process-group
|
||||||
|
|
||||||
# Bash ignores SIGTERM, so we send SIGHUP first, to ensure that bash
|
# Bash ignores SIGTERM, so we send SIGHUP first, to ensure that bash
|
||||||
# terminates cleanly.
|
# terminates cleanly.
|
||||||
ExecStop=/bin/kill -HUP $(MAINPID)
|
ExecStop=-/bin/kill -HUP $(MAINPID)
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Halt
|
Description=Halt
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target killall.service
|
Requires=shutdown.target umount.target killall.service
|
||||||
After=shutdown.target killall.service
|
Conflicts=sysinit.service
|
||||||
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
|
After=shutdown.target umount.target killall.service sysinit.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=finish
|
Type=finish
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Power-Off
|
Description=Power-Off
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target killall.service
|
Requires=shutdown.target umount.target killall.service
|
||||||
After=shutdown.target killall.service
|
Conflicts=sysinit.service
|
||||||
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
|
After=shutdown.target umount.target killall.service sysinit.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=finish
|
Type=finish
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Reboot
|
Description=Reboot
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Requires=shutdown.target killall.service
|
Requires=shutdown.target umount.target killall.service
|
||||||
After=shutdown.target killall.service
|
Conflicts=sysinit.service
|
||||||
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
|
After=shutdown.target umount.target killall.service sysinit.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=finish
|
Type=finish
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Initialization
|
Description=System Initialization
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Before=local-fs.target remote-fs.target swap.target sockets.target
|
Before=emergency.service emergency.target
|
||||||
Conflicts=shutdown.target
|
|
||||||
Before=shutdown.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/etc/rc.d/rc.sysinit
|
ExecStart=/etc/rc.d/rc.sysinit
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Multi-User
|
Description=Multi-User
|
||||||
Requires=basic.target
|
Requires=basic.target
|
||||||
After=basic.target
|
Conflicts=rescue.target shutdown.target
|
||||||
Conflicts=rescue.target
|
After=basic.target rescue.target
|
||||||
m4_dnl
|
m4_dnl
|
||||||
m4_ifdef(`TARGET_FEDORA',
|
m4_ifdef(`TARGET_FEDORA',
|
||||||
m4_dnl On Fedora Runlevel 3 is multi-user
|
m4_dnl On Fedora Runlevel 3 is multi-user
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
# See systemd.special(7) for details
|
# See systemd.special(7) for details
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Rescue Prompt
|
Description=Rescue Mode
|
||||||
Requires=basic.target
|
Requires=sysinit.target local-fs.target swap.target shutdown.target
|
||||||
After=basic.target
|
Conflicts=emergency.service emergency.target
|
||||||
|
After=sysinit.target local-fs.target swap.target shutdown.target emergency.service emergency.target
|
||||||
Names=runlevel1.target
|
Names=runlevel1.target
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Systemd Initialization
|
Description=Systemd Initialization
|
||||||
Conflicts=emergency.service
|
Conflicts=emergency.service emergency.target
|
||||||
|
After=emergency.service emergency.target
|
||||||
OnlyByDependency=yes
|
OnlyByDependency=yes
|
||||||
m4_dnl
|
m4_dnl
|
||||||
m4_ifdef(`TARGET_FEDORA',
|
m4_ifdef(`TARGET_FEDORA',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user