diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-06 00:26:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-06 03:16:39 +0100 |
commit | a354329f724d6ce913d2ccffb2be8f3327a67faa (patch) | |
tree | b6b05cc2c42c274f8385a16b1896d6c88bf4fc8f /src/core/unit.h | |
parent | 75399049653f2d5e22032da70cf96f20d7b4d9a6 (diff) |
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.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r-- | src/core/unit.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/unit.h b/src/core/unit.h index 19fa2f0585..53b8a7f66b 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -345,6 +345,10 @@ struct UnitVTable { * way */ bool (*check_gc)(Unit *u); + /* When the unit is not running and no job for it queued we + * shall release its runtime resources */ + void (*release_resources)(Unit *u); + /* Return true when this unit is suitable for snapshotting */ bool (*check_snapshot)(Unit *u); @@ -359,7 +363,7 @@ struct UnitVTable { void (*notify_cgroup_empty)(Unit *u); /* Called whenever a process of this unit sends us a message */ - void (*notify_message)(Unit *u, pid_t pid, char **tags); + void (*notify_message)(Unit *u, pid_t pid, char **tags, FDSet *fds); /* Called whenever a name this Unit registered for comes or * goes away. */ |