diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-28 18:48:42 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-28 18:48:42 +0100 |
commit | 3282591dc30b2934a895c7403d2f0b0690260947 (patch) | |
tree | 68fef5b38a9b448fcdcd8e48be65daa38470acc7 /src/core/job.c | |
parent | 2fcee0a59a48a1381bb4c0ecf5a2dcbb1015341e (diff) |
core: make sure "systemctl reload-or-try-restart is actually a noop if a unit is not running
This makes sure we follow the same basic logic for try-restart if we have a try-reload.
Fixes #688
Diffstat (limited to 'src/core/job.c')
-rw-r--r-- | src/core/job.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/job.c b/src/core/job.c index 274c554da9..4e111ffb46 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -405,6 +405,13 @@ JobType job_type_collapse(JobType t, Unit *u) { return JOB_RESTART; + case JOB_TRY_RELOAD: + s = unit_active_state(u); + if (UNIT_IS_INACTIVE_OR_DEACTIVATING(s)) + return JOB_NOP; + + return JOB_RELOAD; + case JOB_RELOAD_OR_START: s = unit_active_state(u); if (UNIT_IS_INACTIVE_OR_DEACTIVATING(s)) @@ -1202,6 +1209,7 @@ static const char* const job_type_table[_JOB_TYPE_MAX] = { [JOB_RELOAD_OR_START] = "reload-or-start", [JOB_RESTART] = "restart", [JOB_TRY_RESTART] = "try-restart", + [JOB_TRY_RELOAD] = "try-reload", [JOB_NOP] = "nop", }; |