chiark / gitweb /
service: pass via FAILED/DEAD before going to AUTO_RESTART
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 26 Jun 2012 09:42:52 +0000 (11:42 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Tue, 26 Jun 2012 09:42:52 +0000 (11:42 +0200)
commit0c7f15b3a95c3596a4756de5c44eb1fdcd0034fc
treeb3c00ed316a1df5a01a69a90a7bc24255b324ab7
parente201a0384da94f57f65c951a97d8ddaf990d6240
service: pass via FAILED/DEAD before going to AUTO_RESTART

With misconfigured mysql, which uses Restart=always, the following two
messages would loop indefinitely and the "systemctl start" would never
finish:
  Job pending for unit, delaying automatic restart.
  mysqld.service holdoff time over, scheduling restart.

In service_enter_dead() always set the state to SERVICE_FAILED/DEAD first
before setting SERVICE_AUTO_RESTART. This is to allow running jobs to
complete. OnFailure will be also triggered at this point, so there's no
need to do it again from service_stop() (where it was added in commit
f0c7b229).

Note that OnFailure units should better trigger only after giving up
auto-restarting, but that's for another patch to solve.

https://bugzilla.redhat.com/show_bug.cgi?id=832039
src/core/service.c