From owner-freebsd-rc@FreeBSD.ORG Tue Sep 17 06:13:35 2013 Return-Path: Delivered-To: rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 39AB1A09 for ; Tue, 17 Sep 2013 06:13:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3138B2D3E for ; Tue, 17 Sep 2013 06:13:34 +0000 (UTC) Received: from alph.d.allbsd.org (p4034-ipbf2106funabasi.chiba.ocn.ne.jp [114.148.167.34]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r8H6DHc5092758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Sep 2013 15:13:27 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id r8H6DG49046907; Tue, 17 Sep 2013 15:13:16 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 17 Sep 2013 15:13:03 +0900 (JST) Message-Id: <20130917.151303.535278436892520110.hrs@allbsd.org> To: jmg@funkthat.com Subject: Re: sendmail queue runner starting multiple times... From: Hiroki Sato In-Reply-To: <20130917045530.GL68682@funkthat.com> References: <20130916214901.GE68682@funkthat.com> <20130917.133239.1751419599170896640.hrs@allbsd.org> <20130917045530.GL68682@funkthat.com> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Sep_17_15_13_03_2013_831)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 17 Sep 2013 15:13:27 +0900 (JST) X-Spam-Status: No, score=-92.2 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT,RCVD_IN_PBL,RCVD_IN_RP_RNBL,SAMEHELOBY2HOP,SPF_SOFTFAIL, USER_IN_WHITELIST,X_CHINESE_RELAY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 06:13:35 -0000 ----Security_Multipart(Tue_Sep_17_15_13_03_2013_831)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit John-Mark Gurney 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 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 ----Security_Multipart(Tue_Sep_17_15_13_03_2013_831)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlI38u8ACgkQTyzT2CeTzy1ujwCfd5l8UR5/K8ufd14enMTO6Cr7 gKoAnjPnsqSe7qESzpUqTdjqe3OeO5H6 =slIt -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Sep_17_15_13_03_2013_831)----