Skip to content

Commit

Permalink
rspamd: Create rundir via SMF method script.
Browse files Browse the repository at this point in the history
Fixes first run after reboot.  Bump PKGREVISION.
  • Loading branch information
jperkin committed Jan 6, 2020
1 parent fc67d30 commit 90acefd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mail/rspamd/Makefile
Original file line number Diff line number Diff line change
@@ -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/}

Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion mail/rspamd/files/smf/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<service_fmri value="svc:/system/filesystem/local" />
</dependency>
<method_context></method_context>
<exec_method type="method" name="start" exec="@PREFIX@/bin/rspamd -u @RSPAMD_USER@ -g @RSPAMD_USER@ -c %{config_file}" timeout_seconds="60" />
<exec_method type="method" name="start" exec="@PREFIX@/@SMF_METHOD_FILE.rspamd@ -u @RSPAMD_USER@ -g @RSPAMD_USER@ -c %{config_file}" timeout_seconds="60" />
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="contract" />
Expand Down
14 changes: 14 additions & 0 deletions mail/rspamd/files/smf/rspamd.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 90acefd

Please sign in to comment.