Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionJonathan Kamens
2022-02-08 13:42:50 UTC
Created attachment 1859798[details]
patch
Jan 17 18:25:32 jik4 systemd[1]: sm-client.service: Failed to parse PID from file /run/sm-client.pid: Invalid argument
Jan 17 20:25:03 jik4 systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No such file or directory
The fix is to put a brief sleep in an ExecStartPost command in the service unit file to give them time to fork and create their PID in the child.
See the attached patch, which introduces delays which I've empirically determined (by restarting sendmail and sm-client daily with these delays in place for several weeks) are long enough to give the PID files time to be created.
0.2 seconds, the delay in my diff, apparently isn't a long enough sleep on reboot. I just rebooted and got the error about sendmail.pid not existing yet. I suggest using 0.3 instead of 0.2.
Welp, apparently 0.3 isn't long enough either, so I suppose at least 0.4 seconds is necessary. Just rounding up to 1 second I suppose wouldn't hurt anything and would give a big error bar.
Comment 4Jaroslav Škarvada
2023-07-13 16:12:17 UTC
This is both systemd.
> Jan 17 18:25:32 jik4 systemd[1]: sm-client.service: Failed to parse PID from file /run/sm-client.pid: Invalid argument
This is because the /run/sm-client.pid historically contains two lines:
# cat /run/sm-client.pid
6018
/usr/sbin/sendmail -L sm-msp-queue -Ac -q1h
I.e. the PID and the command. It behaves this way for decades and it's unlikely sendmail upstream would accept any change of it due to the backward compatibility, thus systemd should cope with it.
> Jan 17 20:25:03 jik4 systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No such file or directory
This is because of the way the sendmail daemon is written - the parent process can exit before the child PID is written. Again it behaves this way for decades and it's unlikely sendmail upstream would accept any rewrite of the daemon forking routine. AFAIK systemd contains some mitigations for the legacy daemons behaving this way, thus I don't know why it doesn't work in your case. I think for the forking service the systemd could wait for the PID, e.g. 1 second wait limit shouldn't cause any harm. Empiric sleeps in the service file aren't the way to go. Maybe it's just the diagnostic message from the systemd that the PID isn't there at the time the parent process exited and it will correctly read the PID once it appears. In such case there could be a mechanism how to silence such diagnostic messages on the production system.
Comment 5RHEL Program Management
2023-08-08 07:28:35 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.
Created attachment 1859798 [details] patch Jan 17 18:25:32 jik4 systemd[1]: sm-client.service: Failed to parse PID from file /run/sm-client.pid: Invalid argument Jan 17 20:25:03 jik4 systemd[1]: sendmail.service: Can't open PID file /run/sendmail.pid (yet?) after start: No such file or directory The fix is to put a brief sleep in an ExecStartPost command in the service unit file to give them time to fork and create their PID in the child. See the attached patch, which introduces delays which I've empirically determined (by restarting sendmail and sm-client daily with these delays in place for several weeks) are long enough to give the PID files time to be created.