albatross/packaging/FreeBSD/rc.d/albatross_stat

41 lines
866 B
Plaintext
Raw Permalink Normal View History

2018-10-05 22:46:53 +00:00
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: albatross_stat
# REQUIRE: LOGIN
# KEYWORD: shutdown
2018-10-05 22:46:53 +00:00
#
# Define these albatross_stat_* variables in one of these files
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/albatross_stat
# /usr/local/etc/rc.conf.d/albatross_stat
#
# albatross_stat_flags:
# Default: ""
#
. /etc/rc.subr
name=albatross_stat
rcvar=${name}_enable
desc="Albatross stat service"
load_rc_config $name
start_cmd="albatross_stat_start"
: ${albatross_stat_enable:="NO"}
: ${albatross_stat_flags:=""}
: ${albatross_stat_user:="albatross"}
pidfile="/var/run/albatross_stat.pid"
2019-03-27 23:11:43 +00:00
procname="/usr/local/libexec/albatross/albatross_stats"
2018-10-05 22:46:53 +00:00
albatross_stat_start () {
echo "Starting ${name}."
2018-10-05 22:46:53 +00:00
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_stat_user}" \
"${procname}" ${albatross_stat_flags}
2018-10-05 22:46:53 +00:00
}
run_rc_command "$1"