summaryrefslogtreecommitdiff
path: root/mail/sid-milter/files
diff options
context:
space:
mode:
authorpettai <pettai@pkgsrc.org>2012-04-04 22:09:49 +0000
committerpettai <pettai@pkgsrc.org>2012-04-04 22:09:49 +0000
commite34253b5696f4db2ab7cf1119fbad35a5701be85 (patch)
tree9ad05050bad5ca66346185856cfa69d97c2b16e6 /mail/sid-milter/files
parent348f5de58fd3f53a05db2fb5f5c7cda7eaf20a55 (diff)
downloadpkgsrc-e34253b5696f4db2ab7cf1119fbad35a5701be85.tar.gz
Fixes for PR pkg/45818 (#1 and #2)
Diffstat (limited to 'mail/sid-milter/files')
-rwxr-xr-xmail/sid-milter/files/sid-filter.sh38
-rwxr-xr-xmail/sid-milter/files/sid-milter.sh24
2 files changed, 38 insertions, 24 deletions
diff --git a/mail/sid-milter/files/sid-filter.sh b/mail/sid-milter/files/sid-filter.sh
new file mode 100755
index 00000000000..006acb23bf1
--- /dev/null
+++ b/mail/sid-milter/files/sid-filter.sh
@@ -0,0 +1,38 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: sid-filter.sh,v 1.1 2012/04/04 22:09:49 pettai Exp $
+#
+# PROVIDE: sidfilter
+# REQUIRE: DAEMON
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="sidfilter"
+rcvar=$name
+command="@PREFIX@/bin/sid-filter"
+pidfile="@VARBASE@/run/sid-filter/${name}.pid"
+command_args="-p local:@VARBASE@/run/sid-filter/${name}.sock -P ${pidfile} -l"
+start_precmd="sidfilter_precmd"
+
+sidfilter_precmd()
+{
+ if [ ! -d @VARBASE@/run/sid-filter ]; then
+ @MKDIR@ @VARBASE@/run/sid-filter
+ @CHMOD@ 0750 @VARBASE@/run/sid-filter
+ @CHOWN@ smmsp:smmsp @VARBASE@/run/sid-filter
+ fi
+
+ if [ -f @VARBASE@/run/sid-filter/${name}.sock ]; then
+ @RM@ -f @VARBASE@/run/sid-filter/${name}.sock
+ fi
+}
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ echo -n " ${name}"
+ ${command} ${sidfilter_flags} ${command_args}
+fi
diff --git a/mail/sid-milter/files/sid-milter.sh b/mail/sid-milter/files/sid-milter.sh
deleted file mode 100755
index 006eee3b5a5..00000000000
--- a/mail/sid-milter/files/sid-milter.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!@RCD_SCRIPTS_SHELL@
-#
-# $NetBSD: sid-milter.sh,v 1.1.1.1 2010/03/12 22:42:55 pettai Exp $
-#
-# PROVIDE: sidfilter
-# REQUIRE: DAEMON
-
-if [ -f /etc/rc.subr ]; then
- . /etc/rc.subr
-fi
-
-name="sidfilter"
-rcvar=$name
-command="@PREFIX@/bin/sid-filter"
-pidfile="/var/run/sid-filter.pid"
-command_args="-l -P ${pidfile}"
-
-if [ -f /etc/rc.subr ]; then
- load_rc_config $name
- run_rc_command "$1"
-else
- echo -n " ${name}"
- ${command} ${sidfilter_flags} ${command_args}
-fi