summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-12 20:16:06 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-12 20:49:32 +0100
commitc4ef331782b4c0c615a258d3a4e6c71d8ccc67e1 (patch)
tree5c14ee06e22af0bd48959f138b24eb5da446a205
parent5bb658a1784a0fd4f0f32adb4b1fb636ff503f7d (diff)
service: process watchdog timeouts with lowest priority
-rw-r--r--src/core/service.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 67d20085e9..3b3f956380 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -263,8 +263,17 @@ static void service_start_watchdog(Service *s) {
}
r = sd_event_source_set_enabled(s->watchdog_event_source, SD_EVENT_ONESHOT);
- } else
+ } else {
r = sd_event_add_monotonic(UNIT(s)->manager->event, s->watchdog_timestamp.monotonic + s->watchdog_usec, 0, service_dispatch_watchdog, s, &s->watchdog_event_source);
+ if (r < 0) {
+ log_warning_unit(UNIT(s)->id, "%s failed to add watchdog timer: %s", UNIT(s)->id, strerror(-r));
+ return;
+ }
+
+ /* Let's process everything else which might be a sign
+ * of living before we consider a service died. */
+ r = sd_event_source_set_priority(s->watchdog_event_source, SD_EVENT_PRIORITY_IDLE);
+ }
if (r < 0)
log_warning_unit(UNIT(s)->id, "%s failed to install watchdog timer: %s", UNIT(s)->id, strerror(-r));