Bug 75680 - systemd-notify notifications often lost
Summary: systemd-notify notifications often lost
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-03-02 19:20 UTC by Jan Alexander Steffens (heftig)
Modified: 2015-09-19 13:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jan Alexander Steffens (heftig) 2014-03-02 19:20:54 UTC
I have a shell script service here using systemd-notify for readiness and watchdog, with NotifyAccess=all. In the journal I often see messages like "systemd[1]: Cannot find unit for notify message of PID 9834", with subsequent watchdog timeouts by my service.

Is systemd trying to find out the unit of the notification sender, but the sender (a forked systemd-notify) has already terminated?

Sometimes it even happens when the service is started, so the READY message is lost.

I think this currently makes systemd-notify useless.

systemd 210
Comment 1 Lennart Poettering 2014-05-24 09:22:45 UTC
One option would be to change systemd-notify to fake the ucred bits of the message systemd-notify sends to contain the PID of the parent of the process, rather than its own. This will not fix the issue fully, but it will fix many instances of it, where the parent process is long-running, where it usually is.
Comment 2 Zbigniew Jedrzejewski-Szmek 2014-06-21 03:38:50 UTC
(In reply to comment #1)
> One option would be to change systemd-notify to fake the ucred bits of the
> message systemd-notify sends to contain the PID of the parent of the
> process, rather than its own. This will not fix the issue fully, but it will
> fix many instances of it, where the parent process is long-running, where it
> usually is.
This is implemented in http://cgit.freedesktop.org/systemd/systemd/commit/?id=be8f4e9e.


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.