summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-26 04:23:09 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-26 04:23:09 +0000
commitefb30ba1a6476240688b218224ac22c0fa77b8d7 (patch)
treebd883201596d8aa3c18209b4c9e79ea6822eeb86
parente05ac0557f10536c213bf93a3e23e1c82de288bb (diff)
core: don't allow manual start with reload-or-restart too
fix bug: systemctl reload-or-restart starts a service with RefuseManualStart=yes
-rw-r--r--src/core/dbus-unit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index b2b9eceeb3..7220fe688f 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -986,7 +986,8 @@ int bus_unit_queue_job(
if ((type == JOB_START && u->refuse_manual_start) ||
(type == JOB_STOP && u->refuse_manual_stop) ||
- ((type == JOB_RESTART || type == JOB_TRY_RESTART) && (u->refuse_manual_start || u->refuse_manual_stop)))
+ ((type == JOB_RESTART || type == JOB_TRY_RESTART) && (u->refuse_manual_start || u->refuse_manual_stop)) ||
+ (type == JOB_RELOAD_OR_START && job_type_collapse(type, u) == JOB_START && u->refuse_manual_start))
return sd_bus_error_setf(error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, unit %s may be requested by dependency only.", u->id);
r = manager_add_job(u->manager, type, u, mode, true, error, &j);