Date: Tue, 17 Sep 2013 15:13:03 +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.151303.535278436892520110.hrs@allbsd.org> In-Reply-To: <20130917045530.GL68682@funkthat.com> References: <20130916214901.GE68682@funkthat.com> <20130917.133239.1751419599170896640.hrs@allbsd.org> <20130917045530.GL68682@funkthat.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
John-Mark Gurney <jmg@funkthat.com> wrote
in <20130917045530.GL68682@funkthat.com>:
jm> Hiroki Sato wrote this message on Tue, Sep 17, 2013 at 13:32 +0900:
jm> > John-Mark Gurney <jmg@funkthat.com> wrote
jm> > in <20130916214901.GE68682@funkthat.com>:
jm> >
jm> > jm> I noticed that if you start sendmail, it doesn't detect that the
jm> > jm> mail queue runner is already running and starts it up multiple times...
jm> > jm>
jm> > jm> My proposed patch is:
jm> > jm> --- /usr/src/etc/rc.d/sendmail 2013-01-12 21:34:02.000000000 -0800
jm> > jm> +++ /tmp/sendmail.rc 2013-09-16 14:45:21.000000000 -0700
jm> > jm> @@ -93,7 +93,7 @@
jm> > jm>
jm> > jm> name="sendmail_clientmqueue"
jm> > jm> rcvar="sendmail_msp_queue_enable"
jm> > jm> -start_cmd="${command} ${sendmail_msp_queue_flags}"
jm> > jm> pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
jm> > jm> +start_cmd="[ -z \"`check_pidfile "${pidfile}" "${command}"`\" ] && ${command} ${sendmail_msp_queue_flags} && _run_rc_postcmd"
jm> > jm> required_files="/etc/mail/submit.cf"
jm> > jm> run_rc_command "$1"
jm> > jm>
jm> > jm>
jm> > jm> This is because setting start_cmd disables the pid checks, so we need
jm> > jm> to add them back... This patch won't print out the already running
jm> > jm> bit, but we also don't print out the fact that we are starting it, it
jm> > jm> doesn't seem like that big of a loss..
jm> > jm>
jm> > jm> Is there a better way? If someone else doesn't produce a better patch,
jm> > jm> I'll get re's permission to commit in few days...
jm> > jm>
jm> > jm> Thanks.
jm> > jm>
jm> > jm> P.S. Please CC me, I'm not on the list.
jm> >
jm> > Does the attached patch fix this issue?
jm>
jm> yes, it does, and gives me better messages... I only tested w/
jm> sendmail_enable="YES" and the defaults, but it properly detected the
jm> queue runner running, doesn't start multiple copies, and kills the
jm> queue runner off properly...
jm>
jm> Thanks, do you want to take care of committing, or shall I?
Thank you. I will commit it today. If you notice something wrong,
please let me know.
-- Hiroki
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)
iEYEABECAAYFAlI38u8ACgkQTyzT2CeTzy1ujwCfd5l8UR5/K8ufd14enMTO6Cr7
gKoAnjPnsqSe7qESzpUqTdjqe3OeO5H6
=slIt
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130917.151303.535278436892520110.hrs>
