pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/rspamd rspamd: Create rundir via SMF method script.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/215771145bd7
branches:  trunk
changeset: 347014:215771145bd7
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon Jan 06 12:06:08 2020 +0000

description:
rspamd: Create rundir via SMF method script.

Fixes first run after reboot.  Bump PKGREVISION.

diffstat:

 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(-)

diffs (50 lines):

diff -r 7766577f648b -r 215771145bd7 mail/rspamd/Makefile
--- a/mail/rspamd/Makefile      Mon Jan 06 12:04:12 2020 +0000
+++ b/mail/rspamd/Makefile      Mon Jan 06 12:06:08 2020 +0000
@@ -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_GROUP=${RSPAMD_GROUP}
 
 RCD_SCRIPTS=   rspamd
+SMF_METHODS=   rspamd
 
 CMAKE_ARGS+=   -DMANDIR:PATH=${PREFIX}/${PKGMANDIR}
 CMAKE_ARGS+=   -DLOGDIR:PATH=${LOGDIR}
diff -r 7766577f648b -r 215771145bd7 mail/rspamd/files/smf/manifest.xml
--- a/mail/rspamd/files/smf/manifest.xml        Mon Jan 06 12:04:12 2020 +0000
+++ b/mail/rspamd/files/smf/manifest.xml        Mon Jan 06 12:06:08 2020 +0000
@@ -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" />
diff -r 7766577f648b -r 215771145bd7 mail/rspamd/files/smf/rspamd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/rspamd/files/smf/rspamd.sh   Mon Jan 06 12:06:08 2020 +0000
@@ -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 "$@"



Home | Main Index | Thread Index | Old Index