mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
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>
|
||||
</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>
|
||||
<term>MAINPID=…</term>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
r = impl; \
|
||||
if (r < 0) \
|
||||
(void) sd_notifyf(0, "ERRNO=%i", -r); \
|
||||
(void) sd_notifyf(0, "EXIT_STATUS=%i", ret); \
|
||||
ask_password_agent_close(); \
|
||||
polkit_agent_close(); \
|
||||
pager_close(); \
|
||||
|
||||
Reference in New Issue
Block a user