From 446eca71b7bbaa6f9ada4829eb961adbead8abf8 Mon Sep 17 00:00:00 2001 From: draga79 Date: Fri, 8 Nov 2024 08:01:53 +0000 Subject: [PATCH] Updated FreeBSD rc script On FreeBSD, the snac process is now managed by the daemon(8) utility - this means it will be restarted in case of crash, etc. --- examples/snac_freebsd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/snac_freebsd b/examples/snac_freebsd index d908b6e..1e1faf4 100644 --- a/examples/snac_freebsd +++ b/examples/snac_freebsd @@ -12,8 +12,16 @@ load_rc_config $name : ${snac_enable:=NO} : ${snac_user:="snac"} : ${snac_args:="httpd SNAC_DATA_PATH"} +: ${snac_pidfile:="/var/run/snac/snac.pid"} +: ${snac_rundir:="/var/run/snac"} -command="/usr/local/bin/snac" -command_args="${snac_args} > /var/log/snac.log 2>&1 &" +start_precmd="snac_precmd" +command="/usr/sbin/daemon" +command_args="-P ${snac_pidfile} -r -f /usr/local/bin/snac ${snac_args}" + +snac_precmd() +{ + install -d -m 755 -o ${snac_user} -g ${snac_user} ${snac_rundir} +} run_rc_command "$1" \ No newline at end of file