chiark / gitweb /
units: kill the emergency shell with SIGHUP
[elogind.git] / units / emergency.service
index 3cbca3d..8745d10 100644 (file)
@@ -9,11 +9,15 @@
 
 [Unit]
 Description=Emergency Shell
+DefaultDependencies=no
 
 [Service]
 ExecStart=/bin/sh
-Type=simple
 StandardInput=tty
 Restart=restart-always
 RestartSec=0
-KillMode=process
+KillMode=process-group
+
+# Bash ignores SIGTERM, so we send SIGHUP first, to ensure that bash
+# terminates cleanly.
+ExecStop=/bin/kill -HUP $(MAINPID)