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:
Lennart Poettering
2018-06-01 19:08:30 +02:00
parent 7f66b026bb
commit 2ad2e41a72
13 changed files with 27 additions and 16 deletions
+1 -1
View File
@@ -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);