chiark / gitweb /
util: when releasing terminal, temporarily disable SIGHUP
[elogind.git] / service.c
index 40a02c16e9a99d7211131db103a3667134514ded..298cc27edb56595ce3ade03d5a34667caeb861fc 100644 (file)
--- a/service.c
+++ b/service.c
@@ -661,6 +661,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
 
         /* Special setting for all SysV services */
         s->valid_no_process = true;
+        s->kill_mode = KILL_PROCESS_GROUP;
 
         /* Don't timeout special services during boot (like fsck) */
         if (s->sysv_runlevels && !chars_intersect("12345", s->sysv_runlevels))
@@ -1413,7 +1414,7 @@ static void service_enter_signal(Service *s, ServiceState state, bool success) {
                 }
         }
 
-        if (sent) {
+        if (sent && (s->main_pid > 0 || s->control_pid > 0)) {
                 if (s->timeout_usec > 0)
                         if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
                                 goto fail;