RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1460360 - sd_pid_notify() broken
Summary: sd_pid_notify() broken
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-09 20:16 UTC by Cary Townsend
Modified: 2017-09-07 08:25 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-07 08:25:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Cary Townsend 2017-06-09 20:16:57 UTC
Description of problem:

Attempts to use sd_pid_notify to pet a watchdog from another process fail with EINVAL. Tried the same test with systemd 232 on Ubuntu 17.04 and they work; something apparently needs to be backported.

Version-Release number of selected component (if applicable):
219

How reproducible:
Always

Steps to Reproduce:
1.	export NOTIFY_SOCKET=/run/systemd/notify
2. Invoke sd_pid_notify with a valid pid
3.

Actual results:
EINVAL

Expected results:
1

Additional info:
sd_notify() works fine without error.

strace shows:
sendmsg(4, {msg_name(21)={sa_family=AF_LOCAL, sun_path="/run/systemd/notify"}, msg_iov(1)=[{"WATCHDOG=1\n", 11}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 11

sd_pid_notify() returns EINVAL

strace shows:
sendmsg(4, {msg_name(21)={sa_family=AF_LOCAL, sun_path="/run/systemd/notify"}, msg_iov(1)=[{"WATCHDOG=1\n", 11}], msg_controllen=48, {cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=21134, uid=0, gid=0}}, msg_flags=0}, MSG_NOSIGNAL) = -1 EINVAL (Invalid argument) 
sendmsg(4, {msg_name(21)={sa_family=AF_LOCAL, sun_path="/run/systemd/notify"}, msg_iov(1)=[{"WATCHDOG=1\n", 11}], msg_controllen=16, {cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, ...}, msg_flags=0}, MSG_NOSIGNAL) = -1 EINVAL (Invalid argument)

The systemd folks suggest the following commit:

https://github.com/systemd/systemd/commit/a5bd3c32abb00ad945282568fd1a97c180b68047

Actually found in CentOS 7.3 3.10.0-514.16.1.el7.x86_64

Comment 2 Lukáš Nykrýn 2017-06-12 10:12:44 UTC
I think this might be fixed in latest build prepared for 7.4.
Can you try latest test build from this copr:
https://copr.fedorainfracloud.org/coprs/lnykryn/systemd-rhel-staging/

Comment 4 Cary Townsend 2017-06-12 16:11:28 UTC
Ok, the copr version seems to work fine.  I assume this will show up in CentOS 7.4? (any links / hints as to when that might be?)

Thanks!

Comment 5 Jan Synacek 2017-06-13 08:24:23 UTC
(In reply to Cary Townsend from comment #4)
> Ok, the copr version seems to work fine.  I assume this will show up in
> CentOS 7.4? (any links / hints as to when that might be?)

It probably will, but note that this is a RHEL bugzilla, not CentOS. But since the fix is already in our copr, it will most likely show in RHEL-7.4.


Note You need to log in before you can comment on or make changes to this bug.