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:           Sun Jul 30 03:05:59 UTC 2017

Modified Files:
        pkgsrc/mail/qmail-run: Makefile
        pkgsrc/mail/qmail-run/files: qmail.sh qmailqread.sh

Log Message:
pkgsrc changes:

- Collapse redundant code for invoking service-specific rc.d scripts.
- Don't try to run a service's rc.d script if it isn't enabled in rc.conf.
- Run "pause" in reverse sequence, like "stop" does.
- Support "stat", "pause", and "cont" in qmailqread.

Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 pkgsrc/mail/qmail-run/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/mail/qmail-run/files/qmail.sh
cvs rdiff -u -r1.11 -r1.12 pkgsrc/mail/qmail-run/files/qmailqread.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.40 pkgsrc/mail/qmail-run/Makefile:1.41
--- pkgsrc/mail/qmail-run/Makefile:1.40 Fri Jul 21 04:08:15 2017
+++ pkgsrc/mail/qmail-run/Makefile      Sun Jul 30 03:05:58 2017
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.40 2017/07/21 04:08:15 schmonz Exp $
+# $NetBSD: Makefile,v 1.41 2017/07/30 03:05:58 schmonz Exp $
 #
 
-DISTNAME=              qmail-run-20170721
+DISTNAME=              qmail-run-20170729
 CATEGORIES=            mail
 MASTER_SITES=          # empty
 DISTFILES=             # empty

Index: pkgsrc/mail/qmail-run/files/qmail.sh
diff -u pkgsrc/mail/qmail-run/files/qmail.sh:1.5 pkgsrc/mail/qmail-run/files/qmail.sh:1.6
--- pkgsrc/mail/qmail-run/files/qmail.sh:1.5    Sat Jun 17 05:58:39 2017
+++ pkgsrc/mail/qmail-run/files/qmail.sh        Sun Jul 30 03:05:59 2017
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: qmail.sh,v 1.5 2017/06/17 05:58:39 schmonz Exp $
+# $NetBSD: qmail.sh,v 1.6 2017/07/30 03:05:59 schmonz Exp $
 #
 # @PKGNAME@ master script for administrators to control qmail
 # services. Usage resembles the qmailctl script from "Life with qmail".
@@ -22,32 +22,31 @@ rcd_dir=`@DIRNAME@ $0`
 #
 forward_commands()
 {
-       # Backward compat with NetBSD <1.6:
-       [ -z "$rc_arg" ] && rc_arg=$_arg
-
-       for file in $COMMAND_LIST; do
-               $rcd_dir/$file $rc_arg
-       done
+       qmailrcd $COMMAND_LIST
 }
 
 reverse_commands()
 {
-       # Backward compat with NetBSD <1.6:
-       [ -z "$rc_arg" ] && rc_arg=$_arg
-
        REVCOMMAND_LIST=
        for file in $COMMAND_LIST; do
                REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
        done
-       for file in $REVCOMMAND_LIST; do
-               $rcd_dir/$file $rc_arg
-       done
+
+       qmailrcd $REVCOMMAND_LIST
 }
 
 qmailrcd()
 {
-       for service in $@; do
-               $rcd_dir/qmail${service} $rc_arg
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
+       for service in "$@"; do
+               if [ -f /etc/rc.subr ]; then
+                       load_rc_config $service
+                       checkyesno $service && $rcd_dir/${service} $rc_arg
+               else
+                       $rcd_dir/${service} $rc_arg
+               fi
        done
 }
 
@@ -75,13 +74,13 @@ COMMAND_LIST="qmailsend qmailqread qmail
 name="qmail"
 start_cmd="forward_commands"
 stop_cmd="reverse_commands"
-doqueue_cmd="qmailrcd send"; alrm_cmd=${doqueue_cmd}; flush_cmd=${doqueue_cmd}
+doqueue_cmd="qmailrcd qmailsend"; alrm_cmd=${doqueue_cmd}; flush_cmd=${doqueue_cmd}
 reload_cmd="qmailrcd send"; hup_cmd=${reload_cmd}
 status_cmd="forward_commands"; stat_cmd=${status_cmd}
-pause_cmd="forward_commands"
+pause_cmd="reverse_commands"
 cont_cmd="forward_commands"
-cdb_cmd="qmailrcd smtpd ofmipd pop3d"
-queue_cmd="qmailrcd send"
+cdb_cmd="qmailrcd qmailsmtpd qmailofmipd qmailpop3d"
+queue_cmd="qmailrcd qmailsend"
 help_cmd="qmail_help"
 extra_commands="pause cont stat status cdb doqueue reload queue alrm flush hup help"
 

Index: pkgsrc/mail/qmail-run/files/qmailqread.sh
diff -u pkgsrc/mail/qmail-run/files/qmailqread.sh:1.11 pkgsrc/mail/qmail-run/files/qmailqread.sh:1.12
--- pkgsrc/mail/qmail-run/files/qmailqread.sh:1.11      Sat Jun 17 05:58:39 2017
+++ pkgsrc/mail/qmail-run/files/qmailqread.sh   Sun Jul 30 03:05:59 2017
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: qmailqread.sh,v 1.11 2017/06/17 05:58:39 schmonz Exp $
+# $NetBSD: qmailqread.sh,v 1.12 2017/07/30 03:05:59 schmonz Exp $
 #
 # @PKGNAME@ script to control a service providing local non-root
 # users access to see the queue. Adapted from a script by Steinar Haug.
@@ -29,6 +29,10 @@ rcvar=${name}
 command="${qmailqread_tcpserver}"
 procname=${name}
 start_precmd="qmailqread_precmd"
+extra_commands="stat pause cont"
+stat_cmd="qmailqread_stat"
+pause_cmd="qmailqread_pause"
+cont_cmd="qmailqread_cont"
 
 qmailqread_precmd()
 {
@@ -50,6 +54,31 @@ ${qmailqread_tcphost} ${qmailqread_tcppo
        rc_flags=""
 }
 
+qmailqread_stat()
+{
+       run_rc_command status
+}
+
+qmailqread_pause()
+{
+       if ! statusmsg=`run_rc_command status`; then
+               @ECHO@ $statusmsg
+               return 1
+       fi
+       @ECHO@ "Pausing ${name}."
+       kill -STOP $rc_pid
+}
+
+qmailqread_cont()
+{
+       if ! statusmsg=`run_rc_command status`; then
+               @ECHO@ $statusmsg
+               return 1
+       fi
+       @ECHO@ "Continuing ${name}."
+       kill -CONT $rc_pid
+}
+
 if [ -f /etc/rc.subr ]; then
        load_rc_config $name
        run_rc_command "$1"



Home | Main Index | Thread Index | Old Index