Hide Forgot
Description of problem: At boot or at restart of iscsid service, systemd fails to load the pid from within the SERVICE_START case of service_sigchld_event. Removing PIDFile from .service file does get around the error (fails on PID file %s not readable (yet?)), but per systemd.service documentation PIDFile should be used for forking service. Log snip can be found at https://paste.fedoraproject.org/484515/ - you will see the RH_DEBUG lines just showing which function we come from Version-Release number of selected component (if applicable): kernel-3.10.0-514.el7.x86_64 iscsi-initiator-utils-6.2.0.873-35.el7.x86_64 systemd-219-30.el7.6.x86_64 How reproducible: Install iscsi, enable, and reboot Actual results: Failed to read PID from file /var/run/iscsid.pid: Invalid argument Expected results: Other than not hitting the error every time, unclear at this point. I can not say with confidence whether this is the fault of iscsid or systemd, so I will start it in systemd. Please feel free to change the component. Also, if there is further information needed, please let me know and I would be glad to gather it.
It was just noted that disabling selinux is a workaround for this. selinux-policy-3.13.1-102.el7_3.4.noarch log snip with selinux disabled: https://paste.fedoraproject.org/484529/
Can you provide us the message from /var/log/audit/audit.log why selinux denied accessing that pid file?
There doesn't seem to be a denial, and in my tests today, disabling selinux did not work around the issue, we get the same message of failure. Possibly changed the timing enough in my earlier attempts to get rid of the message.
It looks like the pid file is there, but no pid has been written in it when systemd tries to read it. Does this happen only once on boot? Or every time that you start/restart iscsid?
It happens every time. I've been able to reproduce at boot, with 'systemctl restart iscsid' and 'systemctl stop iscsid ; systemctl start iscsid'.
I managed to reproduce this in my VM. Excerpt from the debug log (with my comments marked): Nov 24 12:47:54 rhel7-virt systemd[1]: About to execute: /usr/sbin/iscsid Nov 24 12:47:54 rhel7-virt systemd[1]: Forked /usr/sbin/iscsid as 1272 Nov 24 12:47:54 rhel7-virt systemd[1]: iscsid.service changed dead -> start Nov 24 12:47:54 rhel7-virt systemd[1]: Starting Open-iSCSI... Nov 24 12:47:54 rhel7-virt systemd[1272]: Executing: /usr/sbin/iscsid Nov 24 12:47:54 rhel7-virt iscsid[1272]: iSCSI logger with pid=1276 started! Nov 24 12:47:54 rhel7-virt iscsid[1276]: iSCSI daemon with pid=1277 started! Nov 24 12:47:54 rhel7-virt systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=82 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd-logind[748]: Got message type=signal sender=:1.0 destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=82 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=83 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd-logind[748]: Got message type=signal sender=:1.0 destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=83 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd[1]: Received SIGCHLD from PID 1272 (iscsid). Nov 24 12:47:54 rhel7-virt systemd[1]: Child 1272 (iscsid) died (code=exited, status=0/SUCCESS) Nov 24 12:47:54 rhel7-virt systemd[1]: Child 1272 belongs to iscsid.service Nov 24 12:47:54 rhel7-virt systemd[1]: iscsid.service: control process exited, code=exited status=0 Nov 24 12:47:54 rhel7-virt systemd[1]: iscsid.service got final SIGCHLD for state start ^^^^ systemd realizes that it got the final SIGCHLD, but the PID file hasn't been written yet (by iscsid). Nov 24 12:47:54 rhel7-virt systemd[1]: Failed to read PID from file /var/run/iscsid.pid: Invalid argument Nov 24 12:47:54 rhel7-virt systemd[1]: Setting watch for iscsid.service's PID file /var/run/iscsid.pid ^^^^ systemd starts watching for the soon-to-be PID file... Nov 24 12:47:54 rhel7-virt systemd[1]: Trying to read iscsid.service's PID file /var/run/iscsid.pid in case it changed Nov 24 12:47:54 rhel7-virt systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=95 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd-logind[748]: Got message type=signal sender=:1.0 destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=95 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=96 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd-logind[748]: Got message type=signal sender=:1.0 destination=n/a object=/org/freedesktop/systemd1/unit/iscsid_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=96 reply_cookie=0 error=n/a Nov 24 12:47:54 rhel7-virt systemd[1]: inotify event for iscsid.service ^^^^ ...and it appears... Nov 24 12:47:54 rhel7-virt systemd[1]: Main PID loaded: 1277 Nov 24 12:47:54 rhel7-virt systemd[1]: Stopping watch for iscsid.service's PID file /var/run/iscsid.pid ^^^^ ...and it is read, everything works as expected Nov 24 12:47:54 rhel7-virt systemd[1]: iscsid.service changed start -> running Nov 24 12:47:54 rhel7-virt systemd[1]: Job iscsid.service/start finished, result=done Nov 24 12:47:54 rhel7-virt systemd[1]: Started Open-iSCSI. Nov 24 12:47:54 rhel7-virt systemd[1]: iscsid.socket changed listening -> running From now on, the service runs without any problems. I don't think that there are any problems with systemd with regards to this bug. If anything should be fixed, it's the iscsid - it should write the file earlier.
Has any progress been made on this? If this is indeed a bug in iscsid, has anyone reported it upstream?
It's been over a year since the last update, any progress on this?
Verified with iscsi-initiator-utils-6.2.0.874-17.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:1124