Bug 217393

Summary: "/etc/rc.d/sendmail restart" doesn't restart the sendmail_msp_queue process
Product: Base System Reporter: martin
Component: binAssignee: Gregory Neil Shapiro <gshapiro>
Status: Closed FIXED    
Severity: Affects Only Me CC: gshapiro
Priority: ---    
Version: 10.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch for testing gshapiro: maintainer-approval+

Description martin 2017-02-27 13:54:53 UTC
Running "/etc/rc.d/sendmail restart" with the default config (i.e. nothing sendmail-related in /etc/rc.conf) restarts sendmail_submit but not sendmail_msp_queue (the warning about sendmail_enable is expected):

$ /etc/rc.d/sendmail restart
Cannot 'restart' sendmail. Set sendmail_enable to YES in /etc/rc.conf or use 'onerestart' instead of 'restart'.
Stopping sendmail_submit.
Waiting for PIDS: 68913.
Starting sendmail_submit.
$ 

Contrast this with stop and start:
$ /etc/rc.d/sendmail stop
Stopping sendmail.
Waiting for PIDS: 69470.
sendmail_submit not running? (check /var/run/sendmail.pid).
Stopping sendmail_msp_queue.
Waiting for PIDS: 68855.
$ /etc/rc.d/sendmail start
Cannot 'start' sendmail. Set sendmail_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
Starting sendmail_submit.
Starting sendmail_msp_queue.
$ 

I think the problem is that the variable _rc_restart_done in /etc/rc.subr is set to true when restarting sendmail_submit and thus prevents restart of sendmail_msp_queue.
Comment 1 Gregory Neil Shapiro freebsd_committer freebsd_triage 2017-06-07 18:22:57 UTC
Created attachment 183308 [details]
Patch for testing

I was able to reproduce and the attached patch fixes it for me.  Please confirm.
Comment 2 martin 2017-06-08 09:26:18 UTC
Comment on attachment 183308 [details]
Patch for testing

Thanks, the patch works for me (10.3-RELEASE-p17) also.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-06-12 01:27:07 UTC
A commit references this bug:

Author: gshapiro
Date: Mon Jun 12 01:26:36 UTC 2017
New revision: 319843
URL: https://svnweb.freebsd.org/changeset/base/319843

Log:
  Fix 'restart' action: rc.subr only expects to restart one service, not two.

  PR:		217393
  Reported by:	Martin Simmons
  MFC after:	1 week

Changes:
  head/etc/rc.d/sendmail
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-03-03 10:32:56 UTC
A commit references this bug:

Author: eadler
Date: Sat Mar  3 10:32:00 UTC 2018
New revision: 330321
URL: https://svnweb.freebsd.org/changeset/base/330321

Log:
  MFC r319843:

  Fix 'restart' action: rc.subr only expects to restart one service, not two.

  PR:		217393

Changes:
_U  stable/11/
  stable/11/etc/rc.d/sendmail