diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-06-05 17:05:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-06-05 17:05:18 +0200 |
commit | be8f4e9e8eb3b0c34a49c2e80a5c5b7dc6d175f0 (patch) | |
tree | 172fdccc7b7033063ecdb8bbd7e5d395e3a91095 /src/systemd/sd-daemon.h | |
parent | 03da8f9459b005d5515d2c34152d43bc63f64c79 (diff) | |
download | systemd-be8f4e9e8eb3b0c34a49c2e80a5c5b7dc6d175f0.tar.gz |
sd-daemon: introduce sd_pid_notify() and sd_pid_notifyf()
sd_pid_notify() operates like sd_notify(), however operates on a
different PID (for example the parent PID of a process).
Make use of this in systemd-notify, so that message are sent from the
PID specified with --pid= rather than the usually shortlived PID of
systemd-notify itself.
This should increase the likelyhood that PID 1 can identify the cgroup
that the notification message was sent from properly.
Diffstat (limited to 'src/systemd/sd-daemon.h')
-rw-r--r-- | src/systemd/sd-daemon.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h index 1d636df3ea..351b4e59c4 100644 --- a/src/systemd/sd-daemon.h +++ b/src/systemd/sd-daemon.h @@ -231,6 +231,18 @@ int sd_notify(int unset_environment, const char *state); int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_(2,3); /* + Similar to sd_notify(), but send the message on behalf of another + process, if the appropriate permissions are available. +*/ +int sd_pid_notify(pid_t pid, int unset_environment, const char *state); + +/* + Similar to sd_notifyf(), but send the message on behalf of another + process, if the appropriate permissions are available. +*/ +int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) _sd_printf_(3,4); + +/* Returns > 0 if the system was booted with systemd. Returns < 0 on error. Returns 0 if the system was not booted with systemd. Note that all of the functions above handle non-systemd boots just |