chiark / gitweb /
unit: allow state change from running to restarting
authorLennart Poettering <lennart@poettering.net>
Tue, 13 Apr 2010 02:51:38 +0000 (04:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 13 Apr 2010 02:51:38 +0000 (04:51 +0200)
service.c
unit.c

index 21e8436661523a8605d78fa4727e1ff29c01d6f6..ddf03bbf12cc528599fc62e08d9bb15d381c99e4 100644 (file)
--- a/service.c
+++ b/service.c
@@ -1461,11 +1461,12 @@ static void service_enter_restart(Service *s) {
         int r;
         assert(s);
 
+        service_enter_dead(s, true, false);
+
         if ((r = manager_add_job(UNIT(s)->meta.manager, JOB_START, UNIT(s), JOB_FAIL, false, NULL)) < 0)
                 goto fail;
 
         log_debug("%s scheduled restart job.", unit_id(UNIT(s)));
-        service_enter_dead(s, true, false);
         return;
 
 fail:
diff --git a/unit.c b/unit.c
index 7d570056b4a41da04bf1b335364a92de9baf6ac0..30ffd9631182d60fb7f2fd331426f8f0329147c6 100644 (file)
--- a/unit.c
+++ b/unit.c
@@ -850,8 +850,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
         assert(u);
         assert(os < _UNIT_ACTIVE_STATE_MAX);
         assert(ns < _UNIT_ACTIVE_STATE_MAX);
-        assert(!(os == UNIT_ACTIVE && ns == UNIT_ACTIVATING));
-        assert(!(os == UNIT_INACTIVE && ns == UNIT_DEACTIVATING));
 
         /* Note that this is called for all low-level state changes,
          * even if they might map to the same high-level