chiark / gitweb /
service: set WATCHDOG_USEC environmen variable
[elogind.git] / src / service.c
index 1631595a288fe9cc4b8856c0f6c9dd7ff5b972d6..a190a73b483d1857d7d76408a1d0be1b2000e13d 100644 (file)
@@ -1735,6 +1735,12 @@ static int service_spawn(
                         goto fail;
                 }
 
+        if (s->watchdog_usec > 0)
+                if (asprintf(our_env + n_env++, "WATCHDOG_USEC=%llu", (unsigned long long) s->watchdog_usec) < 0) {
+                        r = -ENOMEM;
+                        goto fail;
+                }
+
         if (!(final_env = strv_env_merge(2,
                                          UNIT(s)->manager->environment,
                                          our_env,