1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00

service: prohibit Restart= set when Type=oneshot

This commit is contained in:
Maciej Wereski 2013-08-09 12:54:10 +02:00 committed by Lennart Poettering
parent 41efeaec03
commit b0693d3086
2 changed files with 6 additions and 2 deletions

2
TODO
View File

@ -88,8 +88,6 @@ Features:
full, make sure to write how many messages are lost as first thing
to syslog when it works again.
* prohibit Restart= set with Type=oneshot
* man: the documentation of Restart= currently is very misleading and suggests the tools from ExecStartPre= might get restarted.
* load .d/*.conf dropins for device units

View File

@ -1113,6 +1113,12 @@ static int service_verify(Service *s) {
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);
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);