aboutsummaryrefslogtreecommitdiff
path: root/run/anubis.freebsd
blob: 1c980fb4bb8006cf8f8957fb18d4b483f8b66777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

# PROVIDE: anubis
# REQUIRE: NETWORKING
# KEYWORD: shutdown

. /etc/rc.subr

name=anubis
rcvar=anubis_enable

load_rc_config ${name}

: ${anubis_enable="NO"}
: ${anubis_user="anubis"}
: ${anubis_bin="/usr/local/bin/anubis"}
: ${anubis_environment_file="/etc/anubis.env"}

command=/usr/sbin/daemon
procname=${anubis_bin}
pidfile=/var/run/anubis.pid
logfile=/var/log/anubis.log
command_args="-c -f -p ${pidfile} -o ${logfile} ${procname}"
start_precmd=anubis_precmd

anubis_precmd () {
        export $(xargs < ${anubis_environment_file})
        if [ ! -f ${logfile} ]; then
                install -o anubis /dev/null ${logfile}
        fi
        install -o anubis /dev/null ${pidfile}
}

run_rc_command "$1"