From: Lennart Poettering Date: Fri, 29 Oct 2010 02:09:36 +0000 (+0200) Subject: units: make fedora/single.service standard and rename it to rescue.service X-Git-Tag: v12~103 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de47ca9b50e8c05c9fc116ff37794e526bddf92e;p=systemd units: make fedora/single.service standard and rename it to rescue.service --- diff --git a/Makefile.am b/Makefile.am index 683376b9..1fa4a7df 100644 --- a/Makefile.am +++ b/Makefile.am @@ -163,6 +163,7 @@ dist_tmpfiles_DATA = \ dist_systemunit_DATA = \ units/emergency.service \ units/emergency.target \ + units/sysinit.target \ units/basic.target \ units/getty.target \ units/halt.target \ @@ -215,7 +216,6 @@ dist_systemunit_DATA = \ units/systemd-ask-password-plymouth.path nodist_systemunit_DATA = \ - units/sysinit.target \ units/getty@.service \ units/serial-getty@.service \ units/graphical.target \ @@ -247,7 +247,8 @@ nodist_systemunit_DATA = \ units/kexec.service \ units/fsck@.service \ units/fsck-root.service \ - units/quotacheck.service + units/quotacheck.service \ + units/rescue.service dist_sessionunit_DATA = \ units/session/default.target \ @@ -258,12 +259,12 @@ nodist_sessionunit_DATA = \ units/session/exit.service EXTRA_DIST = \ - units/sysinit.target.m4 \ units/getty@.service.m4 \ units/serial-getty@.service.m4 \ units/graphical.target.m4 \ units/multi-user.target.m4 \ units/remote-fs.target.m4 \ + units/rescue.service.m4 \ units/systemd-initctl.service.in \ units/systemd-logger.service.in \ units/systemd-shutdownd.service.in \ @@ -299,7 +300,6 @@ dist_systemunit_DATA += \ units/fedora/prefdm.service \ units/fedora/rc-local.service \ units/fedora/halt-local.service \ - units/fedora/single.service \ units/fedora/plymouth-start.service \ units/fedora/plymouth-quit.service \ units/fedora/plymouth-reboot.service \ @@ -924,7 +924,7 @@ SED_PROCESS = \ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \ -e 's,@prefix\@,$(prefix),g' \ - < $< > $@ + < $< > $@ || rm $@ units/%: units/%.in Makefile $(SED_PROCESS) @@ -937,11 +937,11 @@ man/%: man/%.in Makefile M4_PROCESS_SYSTEM = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@ + $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@ || rm $@ M4_PROCESS_SESSION = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@ + $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@ || rm $@ units/%: units/%.m4 Makefile $(M4_PROCESS_SYSTEM) @@ -1184,9 +1184,6 @@ if TARGET_FEDORA ( cd $(DESTDIR)$(systemunitdir)/final.target.wants && \ rm -f halt-local.service && \ $(LN_S) $(systemunitdir)/halt-local.service halt-local.service ) - ( cd $(DESTDIR)$(systemunitdir)/rescue.target.wants && \ - rm -f single.service && \ - $(LN_S) $(systemunitdir)/single.service single.service ) ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \ rm -f plymouth-quit.service && \ $(LN_S) ../plymouth-quit.service plymouth-quit.service ) diff --git a/units/.gitignore b/units/.gitignore index add0c6b8..e90f6b3d 100644 --- a/units/.gitignore +++ b/units/.gitignore @@ -1,3 +1,4 @@ +rescue.service systemd-ask-password-plymouth.service systemd-ask-password-wall.service quotacheck.service @@ -26,7 +27,6 @@ systemd-random-seed-save.service systemd-initctl.service systemd-logger.service syslog.target -sysinit.target graphical.target multi-user.target getty@.service diff --git a/units/basic.target b/units/basic.target index ecd72ef0..0258ca0c 100644 --- a/units/basic.target +++ b/units/basic.target @@ -9,6 +9,6 @@ [Unit] Description=Basic System -Requires=sysinit.target local-fs.target swap.target sockets.target -After=sysinit.target local-fs.target swap.target sockets.target +Requires=sysinit.target sockets.target +After=sysinit.target sockets.target RefuseManualStart=yes diff --git a/units/emergency.service b/units/emergency.service index e0567825..52f875c6 100644 --- a/units/emergency.service +++ b/units/emergency.service @@ -10,6 +10,8 @@ [Unit] Description=Emergency Shell DefaultDependencies=no +Conflicts=shutdown.target +Before=shutdown.target [Service] Environment=HOME=/root diff --git a/units/multi-user.target.m4 b/units/multi-user.target.m4 index 8f8903f2..8d458c76 100644 --- a/units/multi-user.target.m4 +++ b/units/multi-user.target.m4 @@ -10,8 +10,8 @@ [Unit] Description=Multi-User Requires=basic.target -Conflicts=rescue.target -After=basic.target rescue.target +Conflicts=rescue.service rescue.target +After=basic.target rescue.service rescue.target m4_dnl m4_ifdef(`TARGET_FEDORA', m4_dnl On Fedora Runlevel 3 is multi-user diff --git a/units/fedora/single.service b/units/rescue.service.m4 similarity index 81% rename from units/fedora/single.service rename to units/rescue.service.m4 index f36cbf31..d173beba 100644 --- a/units/fedora/single.service +++ b/units/rescue.service.m4 @@ -10,18 +10,20 @@ [Unit] Description=Rescue Shell DefaultDependencies=no -Conflicts=multi-user.target shutdown.target +Conflicts=shutdown.target After=basic.target -Before=multi-user.target +Before=shutdown.target [Service] Environment=HOME=/root Environment=TERM=vt100-nav -EnvironmentFile=/etc/sysconfig/init WorkingDirectory=/root ExecStartPre=-/bin/plymouth --hide-splash ExecStartPre=-/bin/echo 'Welcome to rescue mode. Use "systemctl default" or ^D to activate default mode.' -ExecStart=-/bin/bash -c "exec $SINGLE" +m4_ifdef(`TARGET_FEDORA', +`EnvironmentFile=/etc/sysconfig/init +ExecStart=-/bin/bash -c "exec $SINGLE"', +`ExecStart=-/sbin/sulogin') ExecStopPost=/bin/systemctl default StandardInput=tty-force KillMode=process-group diff --git a/units/rescue.target b/units/rescue.target index 810fa14d..ff3aef03 100644 --- a/units/rescue.target +++ b/units/rescue.target @@ -9,8 +9,8 @@ [Unit] Description=Rescue Mode -Requires=sysinit.target local-fs.target swap.target -After=sysinit.target local-fs.target swap.target +Requires=basic.target rescue.service +After=basic.target rescue.service Names=runlevel1.target AllowIsolate=yes diff --git a/units/sysinit.target.m4 b/units/sysinit.target similarity index 80% rename from units/sysinit.target.m4 rename to units/sysinit.target index 6a182d40..eb9a1c7c 100644 --- a/units/sysinit.target.m4 +++ b/units/sysinit.target @@ -10,5 +10,6 @@ [Unit] Description=System Initialization Conflicts=emergency.service emergency.target -After=emergency.service emergency.target +Wants=local-fs.target swap.target +After=local-fs.target swap.target emergency.service emergency.target RefuseManualStart=yes