From f71e38db1009e5276a30f7d7734ea2422e17503a Mon Sep 17 00:00:00 2001 From: obache Date: Fri, 28 May 2010 07:26:48 +0000 Subject: Create required directory in pre-start stage, /var/run may be cleared at boot. --- mail/enma/Makefile | 7 +++++-- 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" -- cgit v1.2.3