notify: Add EXIT_STATUS field
Whenever one of our tools or daemons exits, let's send the exit status via sd-notify in the EXIT_STATUS field.
This commit is contained in:
@@ -170,6 +170,13 @@
|
|||||||
<literal>BUSERROR=org.freedesktop.DBus.Error.TimedOut</literal></para></listitem>
|
<literal>BUSERROR=org.freedesktop.DBus.Error.TimedOut</literal></para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>EXIT_STATUS=…</term>
|
||||||
|
|
||||||
|
<listitem><para>If a service exits, the return value of its <function>main()</function> function.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>MAINPID=…</term>
|
<term>MAINPID=…</term>
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
r = impl; \
|
r = impl; \
|
||||||
if (r < 0) \
|
if (r < 0) \
|
||||||
(void) sd_notifyf(0, "ERRNO=%i", -r); \
|
(void) sd_notifyf(0, "ERRNO=%i", -r); \
|
||||||
|
(void) sd_notifyf(0, "EXIT_STATUS=%i", ret); \
|
||||||
ask_password_agent_close(); \
|
ask_password_agent_close(); \
|
||||||
polkit_agent_close(); \
|
polkit_agent_close(); \
|
||||||
pager_close(); \
|
pager_close(); \
|
||||||
|
|||||||
Reference in New Issue
Block a user