aboutsummaryrefslogtreecommitdiffstats
path: root/config/dansguardian
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-11-18 21:25:37 +0100
committerdoktornotor <notordoktor@gmail.com>2015-11-18 21:25:37 +0100
commit8678aa1a3ff0e9b040e2d732a64d96cb1bfeeb6a (patch)
treeb5953cff8ce99c8d06151de6b8d8f00766d00b36 /config/dansguardian
parentead8f184163699bac2cece2113fb2469e0ed5b85 (diff)
downloadpfsense-packages-8678aa1a3ff0e9b040e2d732a64d96cb1bfeeb6a.tar.gz
pfsense-packages-8678aa1a3ff0e9b040e2d732a64d96cb1bfeeb6a.tar.bz2
pfsense-packages-8678aa1a3ff0e9b040e2d732a64d96cb1bfeeb6a.zip
Fix service (re)restart failure due to some lingering /tmp junk
Reported @ https://forum.pfsense.org/index.php?topic=75321.0
Diffstat (limited to 'config/dansguardian')
-rwxr-xr-xconfig/dansguardian/dansguardian_rc.template21
1 files changed, 16 insertions, 5 deletions
diff --git a/config/dansguardian/dansguardian_rc.template b/config/dansguardian/dansguardian_rc.template
index 580fb835..1d63c7ec 100755
--- a/config/dansguardian/dansguardian_rc.template
+++ b/config/dansguardian/dansguardian_rc.template
@@ -14,11 +14,6 @@
#
# dansguardian_enable="YES"
# dansguardian_flags="<set as needed>"
-sysctl kern.ipc.somaxconn=16384
-sysctl kern.maxfiles=131072
-sysctl kern.maxfilesperproc=104856
-sysctl kern.threads.max_threads_per_proc=4096
-
dansguardian_enable=${dansguardian_enable:-"YES"}
dansguardian_pidfile=${dansguardian_pidfile:-"/var/run/dansguardian.pid"}
@@ -27,6 +22,22 @@ dansguardian_pidfile=${dansguardian_pidfile:-"/var/run/dansguardian.pid"}
name="dansguardian"
rcvar=dansguardian_enable
command="/usr/local/sbin/${name}"
+start_precmd="${name}_prestart"
+
+dansguardian_prestart()
+{
+ /sbin/sysctl kern.ipc.somaxconn=16384
+ /sbin/sysctl kern.maxfiles=131072
+ /sbin/sysctl kern.maxfilesperproc=104856
+ /sbin/sysctl kern.threads.max_threads_per_proc=4096
+
+ for i in dguardianipc dguardianipipc dguardianurlipc; do
+ if [ -f "/tmp/.${i}" ]; then
+ /bin/rm -f "/tmp/.${i}"
+ fi
+ done
+ return 0
+}
load_rc_config $name