core: don't trigger OnFailure= deps when a unit is going to restart
This adds a flags parameter to unit_notify() which can be used to pass additional notification information to the function. We the make the old reload_failure boolean parameter one of these flags, and then add a new flag that let's unit_notify() if we are configured to restart the service. Note that this adjusts behaviour of systemd to match what the docs say. Fixes: #8398
This commit is contained in:
+1
-1
@@ -264,7 +264,7 @@ static void timer_set_state(Timer *t, TimerState state) {
|
||||
if (state != old_state)
|
||||
log_unit_debug(UNIT(t), "Changed %s -> %s", timer_state_to_string(old_state), timer_state_to_string(state));
|
||||
|
||||
unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], true);
|
||||
unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], 0);
|
||||
}
|
||||
|
||||
static void timer_enter_waiting(Timer *t, bool initial);
|
||||
|
||||
Reference in New Issue
Block a user