core/service: actually allow to "hurry up" auto restarts
authorMike Yuan <me@yhndnzj.com>
Thu, 1 Aug 2024 00:23:14 +0000 (02:23 +0200)
committerMike Yuan <me@yhndnzj.com>
Sat, 3 Aug 2024 11:03:28 +0000 (13:03 +0200)
commit1391f149f0eea6e9cdd1df7fd25fa2cfd6f21c2c
treec089c188f5c6d9fa477280d30e0159e9c5757adc
parent21e9fcf97f058e3bf401bbf820976cdae530b8d9
core/service: actually allow to "hurry up" auto restarts

unit_start() advertises that start requests don't get suppressed,
so that it could be used to manually speed up auto restarts.
However, service_start() so far rejected this, stating that
clients should issue restart request in order to trigger
BindsTo=/OnFailure=.

That seems to be a red herring though, because for a long time
the service states between auto-restarts were buggy (#27594).
With the introduction of RestartMode=direct, the behavior
is sane again and customizable, hence I see no reason to refuse
this anymore. Whether those deps are triggered solely depends
on RestartMode= now.

Plus, filter out some intermediate states that should never
be seen in service_start().

Fixes #33890
src/core/service.c
test/units/TEST-03-JOBS.sh