Lines Matching refs:state
97 static void scope_set_state(Scope *s, ScopeState state) {
101 old_state = s->state;
102 s->state = state;
104 if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL))
107 if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED))
110 if (state != old_state)
111 log_debug("%s changed %s -> %s", UNIT(s)->id, scope_state_to_string(old_state), scope_state_to_string(state));
113 unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
187 assert(s->state == SCOPE_DEAD);
189 if (s->deserialized_state == s->state)
214 prefix, scope_state_to_string(s->state),
230 static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
244 if (state == SCOPE_STOP_SIGTERM)
251 state != SCOPE_STOP_SIGTERM ? KILL_KILL : KILL_TERMINATE,
263 scope_set_state(s, state);
264 } else if (state == SCOPE_STOP_SIGTERM)
286 if (s->state == SCOPE_FAILED)
290 if (s->state == SCOPE_STOP_SIGTERM ||
291 s->state == SCOPE_STOP_SIGKILL)
294 assert(s->state == SCOPE_DEAD);
320 if (s->state == SCOPE_STOP_SIGTERM ||
321 s->state == SCOPE_STOP_SIGKILL)
324 assert(s->state == SCOPE_RUNNING ||
325 s->state == SCOPE_ABANDONED);
336 if (s->state == SCOPE_FAILED)
371 unit_serialize_item(u, f, "state", scope_state_to_string(s->state));
383 if (streq(key, "state")) {
384 ScopeState state;
386 state = scope_state_from_string(value);
387 if (state < 0)
388 log_unit_debug(u, "Failed to parse state value: %s", value);
390 s->deserialized_state = state;
416 if (IN_SET(s->state, SCOPE_RUNNING, SCOPE_ABANDONED, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL))
442 switch (s->state) {
473 if (!IN_SET(s->state, SCOPE_RUNNING, SCOPE_ABANDONED))
498 return state_translation_table[SCOPE(u)->state];
504 return scope_state_to_string(SCOPE(u)->state);