pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mail/qmail-run



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.

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



Home | Main Index | Thread Index | Old Index