Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2013 13:32:39 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        jmg@funkthat.com
Cc:        rc@FreeBSD.org
Subject:   Re: sendmail queue runner starting multiple times...
Message-ID:  <20130917.133239.1751419599170896640.hrs@allbsd.org>
In-Reply-To: <20130916214901.GE68682@funkthat.com>
References:  <20130916214901.GE68682@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Tue_Sep_17_13_32_39_2013_481)--
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Tue_Sep_17_13_32_39_2013_565)--"
Content-Transfer-Encoding: 7bit

----Next_Part(Tue_Sep_17_13_32_39_2013_565)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

John-Mark Gurney <jmg@funkthat.com> wrote
  in <20130916214901.GE68682@funkthat.com>:

jm> I noticed that if you start sendmail, it doesn't detect that the
jm> mail queue runner is already running and starts it up multiple times...
jm>
jm> My proposed patch is:
jm> --- /usr/src/etc/rc.d/sendmail  2013-01-12 21:34:02.000000000 -0800
jm> +++ /tmp/sendmail.rc    2013-09-16 14:45:21.000000000 -0700
jm> @@ -93,7 +93,7 @@
jm>
jm>  name="sendmail_clientmqueue"
jm>  rcvar="sendmail_msp_queue_enable"
jm> -start_cmd="${command} ${sendmail_msp_queue_flags}"
jm>  pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
jm> +start_cmd="[ -z \"`check_pidfile "${pidfile}" "${command}"`\" ] && ${command} ${sendmail_msp_queue_flags} && _run_rc_postcmd"
jm>  required_files="/etc/mail/submit.cf"
jm>  run_rc_command "$1"
jm>
jm>
jm> This is because setting start_cmd disables the pid checks, so we need
jm> to add them back...  This patch won't print out the already running
jm> bit, but we also don't print out the fact that we are starting it, it
jm> doesn't seem like that big of a loss..
jm>
jm> Is there a better way?  If someone else doesn't produce a better patch,
jm> I'll get re's permission to commit in few days...
jm>
jm> Thanks.
jm>
jm> P.S. Please CC me, I'm not on the list.

 Does the attached patch fix this issue?

-- Hiroki

----Next_Part(Tue_Sep_17_13_32_39_2013_565)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="rc_d_sendmail.20130916-1.diff"

Index: etc/rc.d/sendmail
===================================================================
--- etc/rc.d/sendmail	(revision 255437)
+++ etc/rc.d/sendmail	(working copy)
@@ -80,7 +80,6 @@
 if checkyesno sendmail_submit_enable; then
 	name="sendmail_submit"
 	rcvar="sendmail_submit_enable"
-	start_cmd="${command} ${sendmail_submit_flags}"
 	run_rc_command "$1"
 fi

@@ -87,13 +86,11 @@
 if checkyesno sendmail_outbound_enable; then
 	name="sendmail_outbound"
 	rcvar="sendmail_outbound_enable"
-	start_cmd="${command} ${sendmail_outbound_flags}"
 	run_rc_command "$1"
 fi

-name="sendmail_clientmqueue"
+name="sendmail_msp_queue"
 rcvar="sendmail_msp_queue_enable"
-start_cmd="${command} ${sendmail_msp_queue_flags}"
-pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
+pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
 required_files="/etc/mail/submit.cf"
 run_rc_command "$1"

----Next_Part(Tue_Sep_17_13_32_39_2013_565)----

----Security_Multipart0(Tue_Sep_17_13_32_39_2013_481)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEABECAAYFAlI322cACgkQTyzT2CeTzy17QgCfZZUl1KjA4S94sM4X3kRVuYzL
fo4An1RZBLxOs8gyIsfYeDs2U4fpcFtV
=pSi4
-----END PGP SIGNATURE-----

----Security_Multipart0(Tue_Sep_17_13_32_39_2013_481)----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130917.133239.1751419599170896640.hrs>