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/
Created attachment 102055 [details] Proposed patch
Created attachment 102056 [details] systemd status+errno notify test
Created attachment 102057 [details] service definition for the test
The proposed patch needs some testing on my side yet, that will be done during today.
Created attachment 102186 [details] systemd status+errno notify test Fixed a few missing changes for dbus communication.
Created attachment 102187 [details] systemd status+errno notify test
Created attachment 102188 [details] Proposed patch (corrected)
Created attachment 102366 [details] [review] Proposed patch Adjusted to add a dbus property as StatusText, but StatusErrno, and extended the Service struct.
now it looks like: # systemctl show test [...] StatusText=I'm running, with status 8 StatusErrno=8 [...]
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.