From 8678aa1a3ff0e9b040e2d732a64d96cb1bfeeb6a Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 18 Nov 2015 21:25:37 +0100 Subject: Fix service (re)restart failure due to some lingering /tmp junk Reported @ https://forum.pfsense.org/index.php?topic=75321.0 --- config/dansguardian/dansguardian_rc.template | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'config/dansguardian') 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="" -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 -- cgit v1.2.3