2018-10-05 22:46:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# PROVIDE: albatross_log
|
|
|
|
# REQUIRE: LOGIN
|
2018-11-08 08:42:48 +00:00
|
|
|
# KEYWORD: shutdown
|
2018-10-05 22:46:53 +00:00
|
|
|
#
|
|
|
|
# Define these albatross_log_* variables in one of these files
|
|
|
|
# /etc/rc.conf
|
|
|
|
# /etc/rc.conf.local
|
|
|
|
# /etc/rc.conf.d/albatross_log
|
|
|
|
# /usr/local/etc/rc.conf.d/albatross_log
|
|
|
|
#
|
|
|
|
# albatross_log_flags:
|
|
|
|
# Default: ""
|
|
|
|
#
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name=albatross_log
|
|
|
|
rcvar=${name}_enable
|
|
|
|
desc="Albatross log service"
|
|
|
|
load_rc_config $name
|
|
|
|
start_cmd="albatross_log_start"
|
|
|
|
start_precmd="albatross_log_precmd"
|
|
|
|
|
|
|
|
: ${albatross_log_enable:="NO"}
|
|
|
|
: ${albatross_log_flags:=""}
|
|
|
|
: ${albatross_log_user:="albatross"}
|
|
|
|
|
|
|
|
pidfile="/var/run/albatross_log.pid"
|
2018-10-25 14:55:54 +00:00
|
|
|
procname="/usr/local/libexec/albatross/vmmd_log"
|
2018-10-05 22:46:53 +00:00
|
|
|
logfile="/var/log/albatross"
|
|
|
|
|
|
|
|
albatross_log_precmd () {
|
|
|
|
[ -e "${logfile}" ] ||
|
|
|
|
install -g ${albatross_log_user} -o ${albatross_log_user} \
|
|
|
|
-- /dev/null "${logfile}";
|
|
|
|
}
|
|
|
|
|
|
|
|
albatross_log_start () {
|
|
|
|
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_log_user}" \
|
2018-11-08 07:51:37 +00:00
|
|
|
"${procname}" ${albatross_log_flags}
|
2018-10-05 22:46:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|