]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
core: add new logic for services to store file descriptors in PID 1
authorLennart Poettering <lennart@poettering.net>
Mon, 5 Jan 2015 23:26:25 +0000 (00:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 6 Jan 2015 02:16:39 +0000 (03:16 +0100)
commita354329f724d6ce913d2ccffb2be8f3327a67faa
treeb6b05cc2c42c274f8385a16b1896d6c88bf4fc8f
parent75399049653f2d5e22032da70cf96f20d7b4d9a6
core: add new logic for services to store file descriptors in PID 1

With this change it is possible to send file descriptors to PID 1, via
sd_pid_notify_with_fds() which PID 1 will store individually for each
service, and pass via the usual fd passing logic on next invocation.
This is useful for enable daemon reload schemes where daemons serialize
their state to /run, push their fds into PID 1 and terminate, restoring
their state on next start from the data in /run and passed in from PID
1.

The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on
them, and the service they belong to are either not dead or failed, or
have a job queued.
18 files changed:
Makefile-man.am
man/sd_listen_fds.xml
man/sd_notify.xml
man/systemd.service.xml
src/core/dbus-service.c
src/core/load-fragment-gperf.gperf.m4
src/core/manager.c
src/core/service.c
src/core/service.h
src/core/unit.c
src/core/unit.h
src/libsystemd/libsystemd.sym.m4
src/libsystemd/sd-daemon/sd-daemon.c
src/shared/fdset.c
src/shared/fdset.h
src/shared/util.c
src/shared/util.h
src/systemd/sd-daemon.h