Lines Matching refs:state
100 static void scope_set_state(Scope *s, ScopeState state) { in scope_set_state() argument
104 if (s->state != state) in scope_set_state()
107 old_state = s->state; in scope_set_state()
108 s->state = state; in scope_set_state()
110 if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL)) in scope_set_state()
113 if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED)) { in scope_set_state()
118 if (state != old_state) in scope_set_state()
119 …%s changed %s -> %s", UNIT(s)->id, scope_state_to_string(old_state), scope_state_to_string(state)); in scope_set_state()
121 unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], 0); in scope_set_state()
244 assert(s->state == SCOPE_DEAD); in scope_coldplug()
246 if (s->deserialized_state == s->state) in scope_coldplug()
283 prefix, scope_state_to_string(s->state), in scope_dump()
302 static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) { in scope_enter_signal() argument
320 if (state == SCOPE_STOP_SIGTERM) in scope_enter_signal()
329 state != SCOPE_STOP_SIGTERM ? KILL_KILL : in scope_enter_signal()
342 scope_set_state(s, state); in scope_enter_signal()
343 } else if (state == SCOPE_STOP_SIGTERM) in scope_enter_signal()
365 if (s->state == SCOPE_FAILED) in scope_start()
369 if (IN_SET(s->state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL)) in scope_start()
372 assert(s->state == SCOPE_DEAD); in scope_start()
424 if (IN_SET(s->state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL)) in scope_stop()
427 assert(IN_SET(s->state, SCOPE_RUNNING, SCOPE_ABANDONED)); in scope_stop()
438 if (s->state == SCOPE_FAILED) in scope_reset_failed()
474 (void) serialize_item(f, "state", scope_state_to_string(s->state)); in scope_serialize()
496 ScopeState state; in scope_deserialize_item() local
498 state = scope_state_from_string(value); in scope_deserialize_item()
499 if (state < 0) in scope_deserialize_item()
502 s->deserialized_state = state; in scope_deserialize_item()
540 … if (IN_SET(s->state, SCOPE_RUNNING, SCOPE_ABANDONED, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL)) in scope_notify_cgroup_empty_event()
545 if (IN_SET(s->state, SCOPE_DEAD, SCOPE_FAILED)) in scope_notify_cgroup_empty_event()
565 switch (s->state) { in scope_dispatch_timer()
601 if (!IN_SET(s->state, SCOPE_RUNNING, SCOPE_ABANDONED)) in scope_abandon()
621 return state_translation_table[SCOPE(u)->state]; in scope_active_state()
627 return scope_state_to_string(SCOPE(u)->state); in scope_sub_state_to_string()