Received: by mail.netbsd.org (Postfix, from userid 605) id 8CD2884DFB; Fri, 4 Aug 2017 06:35:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1F95B84D30 for ; Fri, 4 Aug 2017 06:35:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id RmChmbQr3Rqz for ; Fri, 4 Aug 2017 06:35:28 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 942E984DED for ; Fri, 4 Aug 2017 06:35:28 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 8D374FACD; Fri, 4 Aug 2017 06:35:28 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_150182852826240" MIME-Version: 1.0 Date: Fri, 4 Aug 2017 06:35:28 +0000 From: "Amitai Schleier" Subject: CVS commit: pkgsrc/mail/qmail-run To: pkgsrc-changes@NetBSD.org Reply-To: schmonz@netbsd.org X-Mailer: log_accum Message-Id: <20170804063528.8D374FACD@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_150182852826240 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: schmonz Date: Fri Aug 4 06:35:28 UTC 2017 Modified Files: pkgsrc/mail/qmail-run: Makefile pkgsrc/mail/qmail-run/files: qmailsend.sh Log Message: If there's more than one qmail-send running (e.g., /var/qmail2 running from /service), the rc.d script can't tell which is ours. Make and use a pidfile. (The other rc.d scripts set argv[0] to names that are unlikely to collide, but there's no easy way to do that for the qmail-send process exec'd by qmail-start.) Bump PKGREVISION. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 pkgsrc/mail/qmail-run/Makefile cvs rdiff -u -r1.10 -r1.11 pkgsrc/mail/qmail-run/files/qmailsend.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_150182852826240 Content-Disposition: inline Content-Length: 2269 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mail/qmail-run/Makefile diff -u pkgsrc/mail/qmail-run/Makefile:1.41 pkgsrc/mail/qmail-run/Makefile:1.42 --- pkgsrc/mail/qmail-run/Makefile:1.41 Sun Jul 30 03:05:58 2017 +++ pkgsrc/mail/qmail-run/Makefile Fri Aug 4 06:35:28 2017 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.41 2017/07/30 03:05:58 schmonz Exp $ +# $NetBSD: Makefile,v 1.42 2017/08/04 06:35:28 schmonz Exp $ # -DISTNAME= qmail-run-20170729 +DISTNAME= qmail-run-20170804 CATEGORIES= mail MASTER_SITES= # empty DISTFILES= # empty Index: pkgsrc/mail/qmail-run/files/qmailsend.sh diff -u pkgsrc/mail/qmail-run/files/qmailsend.sh:1.10 pkgsrc/mail/qmail-run/files/qmailsend.sh:1.11 --- pkgsrc/mail/qmail-run/files/qmailsend.sh:1.10 Sat Jun 17 05:58:39 2017 +++ pkgsrc/mail/qmail-run/files/qmailsend.sh Fri Aug 4 06:35:28 2017 @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: qmailsend.sh,v 1.10 2017/06/17 05:58:39 schmonz Exp $ +# $NetBSD: qmailsend.sh,v 1.11 2017/08/04 06:35:28 schmonz Exp $ # # @PKGNAME@ script to control qmail-send (local and outgoing mail). # @@ -26,7 +26,10 @@ rcvar=${name} required_files="@PKG_SYSCONFDIR@/control/defaultdelivery" required_files="${required_files} @PKG_SYSCONFDIR@/control/me" command="@PREFIX@/bin/qmail-send" -start_precmd="qmailsend_precmd" +start_precmd="qmailsend_prestart" +start_postcmd="qmailsend_poststart" +stop_postcmd="qmailsend_poststop" +pidfile="@VARBASE@/run/${name}.pid" extra_commands="stat pause cont doqueue reload queue alrm flush hup" stat_cmd="qmailsend_stat" pause_cmd="qmailsend_pause" @@ -37,7 +40,7 @@ alrm_cmd="qmailsend_doqueue" flush_cmd="qmailsend_doqueue" hup_cmd="qmailsend_hup" -qmailsend_precmd() +qmailsend_prestart() { # qmail-start(8) starts the various qmail processes, then exits. # qmail-send(8) is the process we want to signal later. @@ -51,6 +54,16 @@ ${qmailsend_logcmd}" rc_flags="" } +qmailsend_poststart() +{ + echo $! > ${pidfile} +} + +qmailsend_poststop() +{ + rm -f ${pidfile} +} + qmailsend_stat() { run_rc_command status @@ -103,6 +116,7 @@ if [ -f /etc/rc.subr ]; then run_rc_command "$1" else @ECHO_N@ " ${name}" - qmailsend_precmd + qmailsend_prestart eval ${command} ${qmailsend_flags} ${command_args} + qmailsend_poststart fi --_----------=_150182852826240--