chiark / gitweb /
service: really stop watchdog timer when stopping
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 23 Jan 2013 13:12:15 +0000 (14:12 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 25 Jan 2013 00:36:47 +0000 (19:36 -0500)
For services without ExecStop= the state SERVICE_STOP is never entered. as
a result the watchdog timer is not stopped and the service is restarted (if
it is configuered to restart).
Stopping the watchdog timer for SERVICE_STOP_SIGTERM as well fixes this.

src/core/service.c

index ee5a1a41e574b58b51f6894b9bd968a1127bceee..593946e5172e61517a8d7870fb7763857ae816d3 100644 (file)
@@ -1550,7 +1550,7 @@ static void service_set_state(Service *s, ServiceState state) {
                 service_connection_unref(s);
         }
 
                 service_connection_unref(s);
         }
 
-        if (state == SERVICE_STOP)
+        if (state == SERVICE_STOP || state == SERVICE_STOP_SIGTERM)
                 service_stop_watchdog(s);
 
         /* For the inactive states unit_notify() will trim the cgroup,
                 service_stop_watchdog(s);
 
         /* For the inactive states unit_notify() will trim the cgroup,