diff options
author | obache <obache> | 2010-05-28 07:26:48 +0000 |
---|---|---|
committer | obache <obache> | 2010-05-28 07:26:48 +0000 |
commit | 3bc85b84899e50cf7753d3220627ed11fd92d604 (patch) | |
tree | 078bbe615765040f70428a12728f010fe0305bc7 /mail | |
parent | 83e270ab995ac4b022359e223ecb9990708011cc (diff) | |
download | pkgsrc-3bc85b84899e50cf7753d3220627ed11fd92d604.tar.gz |
Create required directory in pre-start stage,
/var/run may be cleared at boot.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/enma/Makefile | 7 | ||||
-rw-r--r-- | mail/enma/files/enma.sh | 14 |
2 files changed, 18 insertions, 3 deletions
diff --git a/mail/enma/Makefile b/mail/enma/Makefile index 78ac521319c..bef3ddcbb01 100644 --- a/mail/enma/Makefile +++ b/mail/enma/Makefile @@ -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_STAGE.daemon= post-configure 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 --git a/mail/enma/files/enma.sh b/mail/enma/files/enma.sh index 68b83c82a32..cb618bba0d8 100644 --- a/mail/enma/files/enma.sh +++ b/mail/enma/files/enma.sh @@ -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 @@ pidfile="@VARBASE@/run/enma/${name}.pid" 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" |