forked from pool/systemd
63 lines
3.2 KiB
Diff
63 lines
3.2 KiB
Diff
From 95d57e7b631a2d78b9b5d841125194052895470f Mon Sep 17 00:00:00 2001
|
|
From: Lennart Poettering <lennart@poettering.net>
|
|
Date: Wed, 29 Jan 2014 13:49:54 +0100
|
|
Subject: [PATCH 2/3] service: allow KillMode=mixed in conjunction with
|
|
PAMName=
|
|
|
|
---
|
|
src/core/service.c | 20 +++++++-------------
|
|
1 file changed, 7 insertions(+), 13 deletions(-)
|
|
|
|
diff --git a/src/core/service.c b/src/core/service.c
|
|
index 6792024..e7f03e1 100644
|
|
--- a/src/core/service.c
|
|
+++ b/src/core/service.c
|
|
@@ -1105,37 +1105,31 @@ static int service_verify(Service *s) {
|
|
return 0;
|
|
|
|
if (!s->exec_command[SERVICE_EXEC_START]) {
|
|
- log_error_unit(UNIT(s)->id,
|
|
- "%s lacks ExecStart setting. Refusing.", UNIT(s)->id);
|
|
+ log_error_unit(UNIT(s)->id, "%s lacks ExecStart setting. Refusing.", UNIT(s)->id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (s->type != SERVICE_ONESHOT &&
|
|
s->exec_command[SERVICE_EXEC_START]->command_next) {
|
|
- log_error_unit(UNIT(s)->id,
|
|
- "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
|
|
+ log_error_unit(UNIT(s)->id, "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) {
|
|
- log_error_unit(UNIT(s)->id,
|
|
- "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
|
|
+ log_error_unit(UNIT(s)->id, "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (s->type == SERVICE_DBUS && !s->bus_name) {
|
|
- log_error_unit(UNIT(s)->id,
|
|
- "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id);
|
|
+ log_error_unit(UNIT(s)->id, "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (s->bus_name && s->type != SERVICE_DBUS)
|
|
- log_warning_unit(UNIT(s)->id,
|
|
- "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id);
|
|
+ log_warning_unit(UNIT(s)->id, "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id);
|
|
|
|
- if (s->exec_context.pam_name && s->kill_context.kill_mode != KILL_CONTROL_GROUP) {
|
|
- log_error_unit(UNIT(s)->id,
|
|
- "%s has PAM enabled. Kill mode must be set to 'control-group'. Refusing.", UNIT(s)->id);
|
|
+ if (s->exec_context.pam_name && !(s->kill_context.kill_mode == KILL_CONTROL_GROUP || s->kill_context.kill_mode == KILL_MIXED)) {
|
|
+ log_error_unit(UNIT(s)->id, "%s has PAM enabled. Kill mode must be set to 'control-group' or 'mixed'. Refusing.", UNIT(s)->id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
--
|
|
1.8.4
|
|
|