diff options
author | kim <kim@pkgsrc.org> | 2019-09-07 17:13:56 +0000 |
---|---|---|
committer | kim <kim@pkgsrc.org> | 2019-09-07 17:13:56 +0000 |
commit | 98df790a186fb1f90614c90c2568f52059573354 (patch) | |
tree | 830b9110ea247079930605add6cee00c1656912e | |
parent | af3802e1cd7ba6007d33a0b512ac92455410b73c (diff) | |
download | pkgsrc-98df790a186fb1f90614c90c2568f52059573354.tar.gz |
Avoid an error about pidfile removal on service stop
-rw-r--r-- | mail/postgrey/Makefile | 6 | ||||
-rw-r--r-- | mail/postgrey/files/postgrey.sh | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/mail/postgrey/Makefile b/mail/postgrey/Makefile index e862a72aac6..20ef40e52ee 100644 --- a/mail/postgrey/Makefile +++ b/mail/postgrey/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.50 2019/09/06 09:58:25 jperkin Exp $ +# $NetBSD: Makefile,v 1.51 2019/09/07 17:13:56 kim Exp $ DISTNAME= postgrey-1.36 -PKGREVISION= 5 +PKGREVISION= 6 CATEGORIES= mail MASTER_SITES= http://postgrey.schweikert.ch/pub/ -MAINTAINER= kim@tac.nyc.ny.us +MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://postgrey.schweikert.ch/ COMMENT= Postfix Greylist Policy Server LICENSE= gnu-gpl-v2 diff --git a/mail/postgrey/files/postgrey.sh b/mail/postgrey/files/postgrey.sh index 36266c91f70..61cdece2276 100644 --- a/mail/postgrey/files/postgrey.sh +++ b/mail/postgrey/files/postgrey.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: postgrey.sh,v 1.2 2011/02/16 19:37:50 shattered Exp $ +# $NetBSD: postgrey.sh,v 1.3 2019/09/07 17:13:56 kim Exp $ # # PROVIDE: postgrey @@ -11,7 +11,7 @@ name="@PKGBASE@" rcvar=$name -pidfile="@VARBASE@/run/${name}.pid" +pidfile="@VARBASE@/run/${name}/${name}.pid" command_interpreter="@PERL@" command="@PREFIX@/sbin/postgrey" command_args="-d --pidfile=${pidfile}" @@ -21,7 +21,16 @@ required_files=" " @PKGBASE@_flags=${@PKGBASE@_flags-"-i 2525"} extra_commands="reload" -stop_postcmd='rm -f $pidfile' +start_precmd="postgrey_precmd" + +postgrey_precmd() +{ + if [ ! -d "@VARBASE@/run/${name}" ]; then + @MKDIR@ "@VARBASE@/run/${name}" + @CHMOD@ 775 "@VARBASE@/run/${name}" + @CHOWN@ @POSTGREY_USER@:@POSTGREY_GROUP@ "@VARBASE@/run/${name}" + fi +} load_rc_config $name run_rc_command "$1" |