From: Alan Jenkins Date: Mon, 14 May 2018 14:45:09 +0000 (+0100) Subject: service: FileDescriptorStoreMax should also imply NotifyAccess X-Git-Tag: v239~256 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4330dc03a06cec196521a37ce6a6d75ce0033c55;p=thirdparty%2Fsystemd.git service: FileDescriptorStoreMax should also imply NotifyAccess Commenting out "WatchdogTimeout=3min" in systemd-logind.service causes NotifyAccess to go from "main" to "none", breaking support for logind restart. Let's fix that. --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 03c7b01b3bb..e200bef7cbc 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -937,7 +937,10 @@ passed to the service manager from a specific service are passed back to the service's main process on the next service restart. Any file descriptors passed to the service manager are automatically closed when POLLHUP or POLLERR is seen on them, or when the service is fully - stopped and no job is queued or being executed for it. + stopped and no job is queued or being executed for it. If this option is used, NotifyAccess= + (see above) should be set to open access to the notification socket provided by systemd. If + NotifyAccess= is not set, it will be implicitly set to + . diff --git a/src/core/service.c b/src/core/service.c index bf4f27880d1..1af30325976 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -715,10 +715,9 @@ static int service_add_extras(Service *s) { if (r < 0) return r; - if (s->type == SERVICE_NOTIFY && s->notify_access == NOTIFY_NONE) - s->notify_access = NOTIFY_MAIN; - - if (s->watchdog_usec > 0 && s->notify_access == NOTIFY_NONE) + /* If the service needs the notify socket, let's enable it automatically. */ + if (s->notify_access == NOTIFY_NONE && + (s->type == SERVICE_NOTIFY || s->watchdog_usec > 0 || s->n_fd_store_max > 0)) s->notify_access = NOTIFY_MAIN; r = service_add_default_dependencies(s);