systemd-notify: Always pass a valid pid to sd_pid_notify
authorBenjamin Robin <dev@benjarobin.fr>
Sat, 19 Sep 2015 19:57:51 +0000 (21:57 +0200)
committerHarald Hoyer <harald@redhat.com>
Sun, 20 Sep 2015 02:02:20 +0000 (04:02 +0200)
commit9de009a9f5dd0eb6eaba878a49d5f3317cc9b8a5
tree573eedd8f1b5da3ecbaa3fad3fbf35818b6b819d
parentdcc26ae383dd935afcbaa263f8db8ee5e1f03fbd
systemd-notify: Always pass a valid pid to sd_pid_notify

If the option --pid was used, take the pid from this option, unless take
the parend pid. Using 0 as pid (ucred of systemd-notify) will result 99% of the
time in a failure with this error: "Cannot find unit for notify message of PID"

Shouldn't we use always the ppid, since the MAINPID is something else ?

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
src/notify/notify.c