1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-25 18:50:18 +03:00

unit: allow state change from running to restarting

This commit is contained in:
Lennart Poettering 2010-04-13 04:51:38 +02:00
parent 7b68387983
commit 9ea9a0c85c
2 changed files with 2 additions and 3 deletions

View File

@ -1461,11 +1461,12 @@ static void service_enter_restart(Service *s) {
int r;
assert(s);
service_enter_dead(s, true, false);
if ((r = manager_add_job(UNIT(s)->meta.manager, JOB_START, UNIT(s), JOB_FAIL, false, NULL)) < 0)
goto fail;
log_debug("%s scheduled restart job.", unit_id(UNIT(s)));
service_enter_dead(s, true, false);
return;
fail:

2
unit.c
View File

@ -850,8 +850,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
assert(u);
assert(os < _UNIT_ACTIVE_STATE_MAX);
assert(ns < _UNIT_ACTIVE_STATE_MAX);
assert(!(os == UNIT_ACTIVE && ns == UNIT_ACTIVATING));
assert(!(os == UNIT_INACTIVE && ns == UNIT_DEACTIVATING));
/* Note that this is called for all low-level state changes,
* even if they might map to the same high-level