[systemd-devel] Don't allow to restart emergency.service/rescue.service

Cameron Norman camerontnorman at gmail.com
Tue May 5 16:49:22 PDT 2015


On Tue, May 5, 2015 at 4:47 PM, Cameron Norman <camerontnorman at gmail.com> wrote:
> On Mon, May 4, 2015 at 5:54 AM, Michael Biebl <mbiebl at gmail.com> wrote:
>> 2015-05-04 14:49 GMT+02:00 Michael Biebl <mbiebl at gmail.com>:
>>> Since emergency.service has
>>> KillMode=process
>>> the running bash kept running, and the result was an unusable system.
>>
>> Btw, what's the reason for using KillMode=process in emergency.service?
>
> It seems to have been there since it was first introduced in 2010.
>
> $ git show 70fcff314feff469a8e61dbe5017ed74f5e0a09d -- units/emergency.service
>

Crap I accidentally sent that. The commit:

commit 70fcff314feff469a8e61dbe5017ed74f5e0a09d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Apr 13 05:18:12 2010 +0200

    units: install a few basic units by default

diff --git a/units/emergency.service b/units/emergency.service
new file mode 100644
index 0000000..2e9d049
--- /dev/null
+++ b/units/emergency.service
@@ -0,0 +1,10 @@
+[Meta]
+Description=Emergency Shell
+
+[Service]
+ExecStart=/bin/sh
+Type=simple
+StandardInput=tty
+Restart=restart-always
+RestartSec=0
+KillMode=process

If I had to take a guess I would say that it was desired to let the
shell do its own process management, but Lennart can only know. Maybe
KillMode=mixed would be better?

Regards,
--
Cameron Norman


More information about the systemd-devel mailing list