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 1253840 - sendmail startup complains "sendmail.pid not readable (yet?) after start"
Summary: sendmail startup complains "sendmail.pid not readable (yet?) after start"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sendmail
Version: 7.3
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1298243
TreeView+ depends on / blocked
 
Reported: 2015-08-14 21:02 UTC by Joseph D. Wagner
Modified: 2023-09-07 18:42 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1057879
Environment:
Last Closed: 2017-01-05 14:28:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joseph D. Wagner 2015-08-14 21:02:48 UTC
+++ This bug was initially created as a clone of Bug #1057879 +++

+++ This bug impacts Red Hat Enterprise Linux 7. +++

Description of problem:

sendmail does start automatically but leaves in logs these:

-- Subject: Unit sendmail.service has begun with start-up
-- Unit sendmail.service has begun starting up.
Jan 25 09:55:36 yyyy systemd[1]: PID file /run/sendmail.pid not readable (yet?) after start.
Jan 25 09:55:35 yyyy sendmail[1060]: starting daemon (8.14.7): SMTP+queueing@01:00:00

(Yes, reversed timestamps are straigth from journalctl output.)


Version-Release number of selected component (if applicable):
sendmail-8.14.7-5.fc21

How reproducible:
always

Steps to Reproduce:
1. run 'systemctl restart  sendmail.service' and read this "pid line" from 'systemctl -l status sendmail.service'

Additional info:
/run/sendmail.pid after a restart has a content like this:

1326
/usr/sbin/sendmail -bd -q1h

Is it possible that whatever tries to read sendmail.pid runs an 'smmsp' user while /run/sendmail.pid has "-rw------- 1 root smmsp" access permits?
On this test installation selinux is turned off so, at least at this stage, it is not involved in blocking that read.

Comment 1 Joseph D. Wagner 2015-08-14 21:03:44 UTC
Permissions on /run/sendmail.pid are not set correctly.  At a minimum, group (smmsp) should be able to read.  Not sure if group needs write.

Comment 3 Sergio Basto 2016-05-27 12:43:58 UTC
From 
[url]https://www.freedesktop.org/software/systemd/man/systemd.service.html[/url]

"Please set PIDFile= accordingly. Note that the daemon should write
that file before finishing with its initialization. Otherwise, systemd
might try to read the file before it exists."

So it looks like sendmail creates pid file before exit ... (makes sense
since sendmail have 2 processes) , editing
/usr/lib/systemd/system/sendmail.service and comment out PIDFile entry
[1], solves the problem, I don't known if it's worth report it, but
seems still works correctly and don't report any warning.   

[1]
#PIDFile=/run/sendmail.pid

Comment 4 Jaroslav Škarvada 2016-10-25 16:31:47 UTC
The core of this problem is that sendmail main process fork the child (the server) and the main process then immediately exits without writing the PID. The PID file is written later at some non-deterministic moment. This is flow of the design. The cleanly written daemon should write the PID in the main process before it exits. Unfortunately this is not easy to fix in sendmail. We tried in the past, but we was not successful to get the fix upstream - the change in behaviour could also break others. Fortunately systemd can cope with this problem and the only drawback is the harmless warning in the journal stating that the PID file wasn't there in time it should be.

Comment 5 Jaroslav Škarvada 2017-01-05 14:28:20 UTC
Closing per comment 4.


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