NetBSD Problem Report #15326

Received: (qmail 6786 invoked from network); 21 Jan 2002 22:39:34 -0000
Message-Id: <20020121223932.29440.qmail@otaku.Xtrmntr.org>
Date: 21 Jan 2002 22:39:32 -0000
From: Lubomir Sedlacik <salo@Xtrmntr.org>
Reply-To: salo@Xtrmntr.org
To: gnats-bugs@gnats.netbsd.org
Subject: patch for mail/qmail, including rc startup script
X-Send-Pr-Version: 3.95

>Number:         15326
>Category:       pkg
>Synopsis:       patch for mail/qmail, including rc startup script
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    schmonz
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 21 22:40:01 +0000 2002
>Closed-Date:    Sun Jul 28 02:00:37 +0000 2002
>Last-Modified:  Sun Jul 28 02:00:37 +0000 2002
>Originator:     Lubomir Sedlacik
>Release:        NetBSD 1.5ZA
>Organization:
>Environment:
>Description:

this patch introduces the rc subsystem script for qmail and according
add-ons in Makefile and small addition to MESSAGE.

>How-To-Repeat:
>Fix:


Index: MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/MESSAGE,v
retrieving revision 1.3
diff -u -r1.3 MESSAGE
--- MESSAGE	2002/01/21 16:00:51	1.3
+++ MESSAGE	2002/01/21 22:37:21
@@ -5,4 +5,6 @@
   _default line in /etc/man.conf or specify this directory in
   MANPATH variable in your environment.

+  To start qmail at startup set qmail=YES in /etc/rc.conf.
+
 ======================================================================
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	2002/01/21 18:45:03	1.6
+++ Makefile	2002/01/21 22:37:21
@@ -39,11 +39,16 @@

 DEINSTALL_EXTRA_TMPL=	${PKGDIR}/DEINSTALL

+FILES_SUBST+=		QMAILDIR=${QMAILDIR}
+FILES_SUBST_SED=	${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/-e s!@/}
+
 pre-build:
 	${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
 	${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail

 post-install:
+	@${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail.sh > ${WRKDIR}/qmail.sh
+	${INSTALL_SCRIPT} ${WRKDIR}/qmail.sh ${PKG_SYSCONFBASE}/rc.d/qmail
 	${MKDIR} ${QMAILDIR}/alias
 	cd ${QMAILDIR}/alias && 				\
 		${TOUCH} .qmail-postmaster .qmail-mailer-daemon .qmail-root


NEW FILE, files/qmail.sh:
^^^^^^^^^^^^^^^^^^^^^^^^^

--- /dev/null	Mon Jan 21 23:34:37 2002
+++ files/qmail.sh	Mon Jan 21 22:50:23 2002
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $NetBSD$
+#
+
+# PROVIDE: mail
+# REQUIRE: LOGIN
+
+#	we could do this, but make mail start late, so that things like
+#	.qmail's and Mailbox'es or Maildir's are not processed until
+#	the system is fully operational
+## REQUIRE: DAEMON
+
+# To start qmail at startup, copy this script to /etc/rc.d and set
+# qmail=YES in /etc/rc.conf.
+
+. /etc/rc.subr
+
+name="qmail"
+rcvar=$name
+required_files="@QMAILDIR@/rc @QMAILDIR@/control/me"
+command="@QMAILDIR@/bin/qmail-send"
+start_precmd="qmail_precmd"
+
+qmail_precmd () {
+	command="@QMAILDIR@/rc"
+	command_args="&"
+}
+
+load_rc_config $name
+run_rc_command "$1"
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->zuntum 
Responsible-Changed-By: zuntum 
Responsible-Changed-When: Mon Jan 28 10:31:49 PST 2002 
Responsible-Changed-Why:  
I'll take a look 
Responsible-Changed-From-To: zuntum->pkg-manager 
Responsible-Changed-By: zuntum 
Responsible-Changed-When: Wed Jun 5 05:15:44 PDT 2002 
Responsible-Changed-Why:  
I have no time to handle it now, nor do I have the rc knowledge to be able to judge whether it's entirely correct or not. 
Responsible-Changed-From-To: pkg-manager->schmonz 
Responsible-Changed-By: schmonz 
Responsible-Changed-When: Mon Jul 22 08:38:47 PDT 2002 
Responsible-Changed-Why:  
State-Changed-From-To: open->closed 
State-Changed-By: schmonz 
State-Changed-When: Sat Jul 27 18:59:44 PDT 2002 
State-Changed-Why:  
Updated the package (and added a sample mailer.conf while I was there). Thanks for the PR! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.