summaryrefslogtreecommitdiff
path: root/src/dbus-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-10 20:57:21 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-11 01:44:37 +0200
commitb5e9dba8d60b8fb80b6302b6ea2cd665b3ab370c (patch)
tree87d329ecaab58cdf203208c945d1a80f7627ce5e /src/dbus-manager.c
parent77d98d666a4ef24ef22f032476fd5d954c1a4699 (diff)
unit: rename OnlyByDependency= to RefuseManualStart= and introduce RefuseManualStop=
Some unit shall never be start on user request (e.g. shutdown.target) others never be stopped on user request (e.g. auditd.servce), hence offer options for both.
Diffstat (limited to 'src/dbus-manager.c')
-rw-r--r--src/dbus-manager.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dbus-manager.c b/src/dbus-manager.c
index 549f175eb9..6d0ecc3df9 100644
--- a/src/dbus-manager.c
+++ b/src/dbus-manager.c
@@ -801,8 +801,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
job_type = JOB_RELOAD;
}
- if (job_type == JOB_START && u->meta.only_by_dependency) {
- dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Unit may be activated by dependency only.");
+ if ((job_type == JOB_START && u->meta.refuse_manual_start) ||
+ (job_type == JOB_STOP && u->meta.refuse_manual_stop) ||
+ ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
+ (u->meta.refuse_manual_start || u->meta.refuse_manual_stop))) {
+ dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only.");
return bus_send_error_reply(m, connection, message, &error, -EPERM);
}