Bug 80749 - RFE: NOTIFY_SOCKET ERRNO is not implemented
Summary: RFE: NOTIFY_SOCKET ERRNO is not implemented
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-01 07:46 UTC by Miguel Angel
Modified: 2014-07-07 15:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (3.87 KB, text/plain)
2014-07-01 07:46 UTC, Miguel Angel
Details
systemd status+errno notify test (3.47 KB, text/plain)
2014-07-01 07:48 UTC, Miguel Angel
Details
service definition for the test (192 bytes, text/plain)
2014-07-01 07:48 UTC, Miguel Angel
Details
systemd status+errno notify test (5.92 KB, text/plain)
2014-07-03 08:48 UTC, Miguel Angel
Details
systemd status+errno notify test (3.47 KB, text/plain)
2014-07-03 08:50 UTC, Miguel Angel
Details
Proposed patch (corrected) (5.92 KB, text/plain)
2014-07-03 08:50 UTC, Miguel Angel
Details
Proposed patch (3.16 KB, patch)
2014-07-07 11:12 UTC, Miguel Angel
Details | Splinter Review

Description Miguel Angel 2014-07-01 07:46:21 UTC
Description of problem:

  NOTIFY_SOCKET specification of systemd [1] describes the ERRNO argument,
that would allow for passing error numbers for 'systemctl status' return,
but it's not implemented [2],[3]

  I discovered it during the design of this specifications: [4]



   I'm am proposing a new dbus field for this message (ERRNO, along with PID, Code, Status). 

   Initially I thought of using the ExecStatus code, but this is overwritten at final daemon exit.

   Also, I think this message has potential [4] to be used as a complement 
to the status string which can be passed via NOTIFY_SOCKET, but as a 
numeric error when a daemon is having any trouble and running in degraded 
mode. Specially when using some HA solution like pacemaker and we need to notify that the service is degraded, but we don't want to bring the service down to communicate an exit code.


[1] http://www.freedesktop.org/software/systemd/man/sd_notify.html
[2] http://cgit.freedesktop.org/systemd/systemd/tree/src/core/service.c?id=194bbe33382f5365be3865ed1779147cb#n3201
[3] http://cgit.freedesktop.org/systemd/systemd/tree/src/systemctl/systemctl.c?id=194bbe33382f5365be3865ed1779147cb#n2882
[4] http://docs-draft.openstack.org/48/97748/1/check/gate-oslo-specs-docs/c4a464e/doc/build/html/
Comment 1 Miguel Angel 2014-07-01 07:46:49 UTC
Created attachment 102055 [details]
Proposed patch
Comment 2 Miguel Angel 2014-07-01 07:48:23 UTC
Created attachment 102056 [details]
systemd status+errno notify test
Comment 3 Miguel Angel 2014-07-01 07:48:41 UTC
Created attachment 102057 [details]
service definition for the test
Comment 4 Miguel Angel 2014-07-01 07:49:04 UTC
The proposed patch needs some testing on my side yet, that will be done during today.
Comment 5 Miguel Angel 2014-07-03 08:48:52 UTC
Created attachment 102186 [details]
systemd status+errno notify test

Fixed a few missing changes for dbus communication.
Comment 6 Miguel Angel 2014-07-03 08:50:10 UTC
Created attachment 102187 [details]
systemd status+errno notify test
Comment 7 Miguel Angel 2014-07-03 08:50:33 UTC
Created attachment 102188 [details]
Proposed patch (corrected)
Comment 8 Miguel Angel 2014-07-07 11:12:01 UTC
Created attachment 102366 [details] [review]
Proposed patch

Adjusted to add a dbus property as StatusText, but StatusErrno,
and extended the Service struct.
Comment 9 Miguel Angel 2014-07-07 11:12:44 UTC
now it looks like:

# systemctl show test
[...]
StatusText=I'm running, with status 8
StatusErrno=8
[...]
Comment 10 Lennart Poettering 2014-07-07 15:04:51 UTC
Fixed in git! Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.