Bug 719884 - sendmail fails to start with systemd test update
sendmail fails to start with systemd test update
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
15
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michal Schmidt
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 494832
  Show dependency treegraph
 
Reported: 2011-07-08 05:55 EDT by Michael Schwendt
Modified: 2011-07-15 09:52 EDT (History)
9 users (show)

See Also:
Fixed In Version: systemd-26-8.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 719931 (view as bug list)
Environment:
Last Closed: 2011-07-15 09:52:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
log messages for bug (328.87 KB, text/plain)
2011-07-08 05:55 EDT, Michael Schwendt
no flags Details
log messages for working systemd version (326.25 KB, text/plain)
2011-07-08 05:56 EDT, Michael Schwendt
no flags Details

  None (edit)
Description Michael Schwendt 2011-07-08 05:55:43 EDT
Created attachment 511883 [details]
log messages for bug

Description of problem: sendmail fails to start after installing systemd test update:

$ rpm -qa systemd\*
systemd-units-26-7.fc15.x86_64
systemd-sysv-26-7.fc15.x86_64
systemd-26-7.fc15.x86_64

Not reproducible with previous stable release: 26-5.fc15
Comment 1 Michael Schwendt 2011-07-08 05:56:23 EDT
Created attachment 511884 [details]
log messages for working systemd version
Comment 2 Michal Schmidt 2011-07-08 07:43:45 EDT
It seems this is not exactly a new bug, but the fixes in systemd-26-7.fc15 uncovered a previously latent bug. The reason I believe so is that the log from the working version (26-5.fc15) shows some unexpected behaviour too:

1. sendmail is started (OK)
2. sendmail is reloaded (OK)
3. Then however sendmail exits unexpectedly:
 [   35.800771] systemd[1]: Received SIGCHLD from PID 1275 (sendmail).
 [   35.801981] systemd[1]: Got SIGCHLD for process 1275 (sendmail)
 [   35.802026] systemd[1]: Child 1275 died (code=exited, status=0/SUCCESS)
 [   35.802031] systemd[1]: Child 1275 belongs to sendmail.service
 [   35.802039] systemd[1]: sendmail.service: main process exited, code=exited, status=0
 [   35.802145] systemd[1]: sendmail.service changed running -> exited

What does "systemctl status sendmail.service" show after booting with the working version (26-5.fc15)?
And what does "cat /var/run/sendmail.pid" show?
Comment 3 Michal Schmidt 2011-07-08 07:49:25 EDT
And here's another thing to test: Remove the line "# pidfile: /var/run/sendmail.pid" from /etc/init.d/sendmail and see what happens after boot with the new systemd version (26-7.fc15).
Comment 4 Michael Schwendt 2011-07-08 07:59:29 EDT
Re: comment 2

# systemctl status sendmail.service
sendmail.service - LSB: start and stop sendmail
	  Loaded: loaded (/etc/rc.d/init.d/sendmail)
	  Active: active (exited) since Fri, 08 Jul 2011 13:56:45 +0200; 1min 8s ago
	 Process: 1502 ExecReload=/etc/rc.d/init.d/sendmail reload (code=exited, status=0/SUCCESS)
	 Process: 1130 ExecStart=/etc/rc.d/init.d/sendmail start (code=exited, status=0/SUCCESS)
	Main PID: 1258 (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/sendmail.service
		  ├ 1516 sendmail: accepting connections
		  └ 1518 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue


# cat /var/run/sendmail.pid
1516
/usr/sbin/sendmail -bd -q1h


Reply to comment 3 will follow...
Comment 5 Michael Schwendt 2011-07-08 08:02:06 EDT
Re: comment 3

With the removed pid line, it started:

# systemctl status sendmail.service
sendmail.service - LSB: start and stop sendmail
	  Loaded: loaded (/etc/rc.d/init.d/sendmail)
	  Active: active (running) since Fri, 08 Jul 2011 14:00:33 +0200; 25s ago
	 Process: 1487 ExecReload=/etc/rc.d/init.d/sendmail reload (code=exited, status=0/SUCCESS)
	 Process: 1131 ExecStart=/etc/rc.d/init.d/sendmail start (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/sendmail.service
		  ├ 1505 sendmail: accepting connections
		  └ 1507 sendmail: Queue runner@01:00:00 for /var/spool/cli...

# cat /var/run/sendmail.pid
1505
/usr/sbin/sendmail -bd -q1h
Comment 6 Michal Schmidt 2011-07-08 08:55:45 EDT
I see. sendmail does not merely reload its configuration on SIGHUP (the reload action). It does a full restart itself and it then runs with a new PID.
(http://www.c3.hu/docs/oreilly/tcpip/sendmail/ch26_03.htm)

This is incorrect behaviour. LSB specifies the "reload" action as:
  cause the configuration of the service to be reloaded without actually
  stopping and restarting the service

If a service does not support a real reload, its initscript should not provide the action.


Could systemd workaround this somehow? It could re-read the pidfile after '/etc/init.d/sendmail reload' finishes. But the reload action merely sends SIGHUP to the sendmail process and nothing guarantees that sendmail has finished its restarting by the time the initscript exits.

For now I'll remove the patch from systemd-26-7.fc15 that uncovered this bug (0001-service-pidfile-in-SysV-chkconfig-header-implies-a-r.patch). However the patch fixes some other bugs, so it would be nice to be able to put it back eventually.


Michael,
see if using "restart" instead of "reload" in /NetworkManager/dispatcher.d/10-sendmail fixes it.
Comment 7 Michal Schmidt 2011-07-08 09:00:35 EDT
[cloned this for sendmail as bug 719931]
Comment 8 Michael Schwendt 2011-07-08 11:09:11 EDT
Yes, success:

# rpm -V sendmail
5S.T.....    /etc/NetworkManager/dispatcher.d/10-sendmail
# systemctl status sendmail.service
sendmail.service - LSB: start and stop sendmail
	  Loaded: loaded (/etc/rc.d/init.d/sendmail)
	  Active: active (running) since Fri, 08 Jul 2011 17:07:00 +0200; 35s ago
	 Process: 1396 ExecStop=/etc/rc.d/init.d/sendmail stop (code=exited, status=0/SUCCESS)
	 Process: 1422 ExecStart=/etc/rc.d/init.d/sendmail start (code=exited, status=0/SUCCESS)
	Main PID: 1435 (sendmail)
	  CGroup: name=systemd:/system/sendmail.service
		  ├ 1435 sendmail: accepting connections
		  └ 1444 sendmail: Queue runner@01:00:00 for /var/spool/cli...
# rpm -qa systemd\*
systemd-26-7.fc15.x86_64
systemd-units-26-7.fc15.x86_64
systemd-sysv-26-7.fc15.x86_64
Comment 9 Michal Schmidt 2011-07-08 18:00:15 EDT
(In reply to comment #6)
> For now I'll remove the patch from systemd-26-7.fc15 that uncovered this bug
> (0001-service-pidfile-in-SysV-chkconfig-header-implies-a-r.patch).

Done, Bodhi update edited:
https://admin.fedoraproject.org/updates/systemd-26-8.fc15
Comment 10 Michal Schmidt 2011-07-15 09:52:21 EDT
Closing. systemd-26-8.fc15, which replaced the updates-testing update with this bug, works fine.

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