chiark / gitweb /
systemctl: show sub state along active state
[elogind.git] / unit.c
diff --git a/unit.c b/unit.c
index d1416e03e988b151a004e5459144014d177a3d9e..3b30c8265f579d6330cd854faf1c01d6b6abfd1d 100644 (file)
--- a/unit.c
+++ b/unit.c
@@ -334,6 +334,12 @@ UnitActiveState unit_active_state(Unit *u) {
         return UNIT_VTABLE(u)->active_state(u);
 }
 
+const char* unit_sub_state_to_string(Unit *u) {
+        assert(u);
+
+        return UNIT_VTABLE(u)->sub_state_to_string(u);
+}
+
 static void complete_move(Set **s, Set **other) {
         assert(s);
         assert(other);
@@ -471,7 +477,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
         assert(u);
         assert(c);
 
-        if (c->output != EXEC_OUTPUT_KERNEL && c->output != EXEC_OUTPUT_SYSLOG)
+        if (c->std_output != EXEC_OUTPUT_KERNEL && c->std_output != EXEC_OUTPUT_SYSLOG)
                 return 0;
 
         /* If syslog or kernel logging is requested, make sure our own
@@ -850,8 +856,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
@@ -1520,9 +1524,10 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
 DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);
 
 static const char* const kill_mode_table[_KILL_MODE_MAX] = {
-        [KILL_PROCESS] = "process",
+        [KILL_CONTROL_GROUP] = "control-group",
         [KILL_PROCESS_GROUP] = "process-group",
-        [KILL_CONTROL_GROUP] = "control-group"
+        [KILL_PROCESS] = "process",
+        [KILL_NONE] = "none"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(kill_mode, KillMode);