chiark / gitweb /
units: make ExecStopPost action part of ExecStart
authorMichal Sekletar <msekleta@redhat.com>
Tue, 8 Jul 2014 15:42:23 +0000 (17:42 +0200)
committerMichal Sekletar <msekleta@redhat.com>
Wed, 9 Jul 2014 16:21:04 +0000 (18:21 +0200)
Currently after exiting rescue shell we isolate default target. User
might want to isolate to some other target than default one. However
issuing systemctl isolate command to desired target would bring system
to default target as a consequence of running ExecStopPost action.

Having common ancestor for rescue shell and possible followup systemctl
default command should fix this. If user exits rescue shell we will
proceed with isolating default target, otherwise, on manual isolate,
parent shell process is terminated and we don't isolate default target,
but target chosen by user.

Suggested-by: Michal Schmidt <mschmidt@redhat.com>
units/emergency.service.in
units/rescue.service.m4.in

index 94c090f654be34b42cf8014ce255dbad86ae0ca1..91fc1bbf51fd4a3baba0eaa0931e554edf0ab38e 100644 (file)
@@ -17,8 +17,7 @@ Environment=HOME=/root
 WorkingDirectory=/root
 ExecStartPre=-/bin/plymouth quit
 ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
-ExecStart=-/sbin/sulogin
-ExecStopPost=@SYSTEMCTL@ --fail --no-block default
+ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default"
 Type=idle
 StandardInput=tty-force
 StandardOutput=inherit
index 552ef8981b5870c81bd2dc9652eba3c12652c55c..ef5436960fcaf04ea9902498e2cba0892ad1e70c 100644 (file)
@@ -18,8 +18,7 @@ Environment=HOME=/root
 WorkingDirectory=/root
 ExecStartPre=-/bin/plymouth quit
 ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.'
-ExecStart=-/sbin/sulogin
-ExecStopPost=-@SYSTEMCTL@ --fail --no-block default
+ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default"
 Type=idle
 StandardInput=tty-force
 StandardOutput=inherit