pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mail/enma Create required directory in pre-start stage,



details:   https://anonhg.NetBSD.org/pkgsrc/rev/358557b6cea9
branches:  trunk
changeset: 575982:358557b6cea9
user:      obache <obache%pkgsrc.org@localhost>
date:      Fri May 28 07:26:48 2010 +0000

description:
Create required directory in pre-start stage,
/var/run may be cleared at boot.

diffstat:

 mail/enma/Makefile      |   7 +++++--
 mail/enma/files/enma.sh |  14 +++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r b0171c83de66 -r 358557b6cea9 mail/enma/Makefile
--- a/mail/enma/Makefile        Fri May 28 05:35:50 2010 +0000
+++ b/mail/enma/Makefile        Fri May 28 07:26:48 2010 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2010/05/16 00:46:34 obache Exp $
+# $NetBSD: Makefile,v 1.6 2010/05/28 07:26:48 obache Exp $
 #
 
 DISTNAME=      enma-1.1.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=enma/}
 
@@ -49,6 +49,9 @@
 SUBST_FILES.daemon=    enma/etc/enma.conf.sample
 SUBST_SED.daemon=      -e 's;daemon;${ENMA_USER};g'
 
+FILES_SUBST+=          ENMA_USER=${ENMA_USER:Q}
+FILES_SUBST+=          ENMA_GROUP=${ENMA_GROUP:Q}
+
 OWN_DIRS_PERMS+=       ${VARBASE}/run/enma ${ENMA_USER} ${ENMA_GROUP} 0700
 
 INSTALLATION_DIRS+=    share/examples/enma
diff -r b0171c83de66 -r 358557b6cea9 mail/enma/files/enma.sh
--- a/mail/enma/files/enma.sh   Fri May 28 05:35:50 2010 +0000
+++ b/mail/enma/files/enma.sh   Fri May 28 07:26:48 2010 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: enma.sh,v 1.2 2009/04/09 02:25:37 obache Exp $
+# $NetBSD: enma.sh,v 1.3 2010/05/28 07:26:48 obache Exp $
 #
 # PROVIDE: enma
 # REQUIRE: NETWORK
@@ -15,5 +15,17 @@
 required_files="@PKG_SYSCONFDIR@/enma.conf"
 command_args="-c @PKG_SYSCONFDIR@/enma.conf"
 
+start_precmd="${name}_prestart"
+
+enma_prestart()
+{
+       if [ ! -d @VARBASE@/run/enma ]; then
+               @MKDIR@ @VARBASE@/run/enma
+               @CHOWN@ @ENMA_USER@ @VARBASE@/run/enma
+               @CHGRP@ @ENMA_GROUP@ @VARBASE@/run/enma
+               @CHMOD@ 0700 @VARBASE@/run/enma
+       fi
+}
+
 load_rc_config ${name}
 run_rc_command "$1"



Home | Main Index | Thread Index | Old Index