From 90acefd509aabb1bfbc5899463e6d313317a514c Mon Sep 17 00:00:00 2001 From: jperkin Date: Mon, 6 Jan 2020 12:06:08 +0000 Subject: [PATCH] rspamd: Create rundir via SMF method script. Fixes first run after reboot. Bump PKGREVISION. --- mail/rspamd/Makefile | 4 +++- mail/rspamd/files/smf/manifest.xml | 2 +- mail/rspamd/files/smf/rspamd.sh | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 mail/rspamd/files/smf/rspamd.sh diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 9c8dd18dda91..bb36106364a9 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.60 2019/12/08 09:32:05 triaxx Exp $ +# $NetBSD: Makefile,v 1.61 2020/01/06 12:06:08 jperkin Exp $ DISTNAME= rspamd-2.2 +PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_GITHUB:=vstakhov/} @@ -49,6 +50,7 @@ FILES_SUBST+= RSPAMD_USER=${RSPAMD_USER} FILES_SUBST+= RSPAMD_GROUP=${RSPAMD_GROUP} RCD_SCRIPTS= rspamd +SMF_METHODS= rspamd CMAKE_ARGS+= -DMANDIR:PATH=${PREFIX}/${PKGMANDIR} CMAKE_ARGS+= -DLOGDIR:PATH=${LOGDIR} diff --git a/mail/rspamd/files/smf/manifest.xml b/mail/rspamd/files/smf/manifest.xml index 031b5ae9df45..c7b6f669c704 100644 --- a/mail/rspamd/files/smf/manifest.xml +++ b/mail/rspamd/files/smf/manifest.xml @@ -11,7 +11,7 @@ - + diff --git a/mail/rspamd/files/smf/rspamd.sh b/mail/rspamd/files/smf/rspamd.sh new file mode 100644 index 000000000000..d5b746ad8bd5 --- /dev/null +++ b/mail/rspamd/files/smf/rspamd.sh @@ -0,0 +1,14 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: rspamd.sh,v 1.1 2020/01/06 12:06:08 jperkin Exp $ +# + +. /lib/svc/share/smf_include.sh + +if [ ! -d @VARBASE@/run/rspamd ]; then + @MKDIR@ @VARBASE@/run/rspamd + @CHMOD@ 0750 @VARBASE@/run/rspamd + @CHOWN@ @RSPAMD_USER@:@RSPAMD_GROUP@ @VARBASE@/run/rspamd +fi + +@PREFIX@/bin/rspamd "$@"