Ansible/roles/sensu.sensu/templates/uchiwa_freebsd.j2
James Tombleson b7facd7394 Role Adjustments
Added Sensu
Moved default role downloads to ./roles
Added unattended-upgrades
2019-04-29 07:08:11 -07:00

28 lines
585 B
Django/Jinja

#!/bin/sh
. /etc/rc.subr
name=uchiwa
rcvar=uchiwa_enable
command="{{ sensu_uchiwa_path }}/go/bin/${name}"
uchiwa_flags="-d {{ sensu_uchiwa_path }} -c {{ sensu_uchiwa_path }}/etc/config.json -p {{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa/public"
load_rc_config $name
pidfile=/var/run/${name}.pid
start_cmd=uchiwa_start
stop_postcmd=uchiwa_cleanup
uchiwa_start() {
echo "Starting uchiwa."
/usr/bin/touch ${pidfile}
/usr/sbin/daemon -cf -p ${pidfile} ${command} ${uchiwa_flags}
}
uchiwa_cleanup() {
[ -f ${pidfile} ] && /bin/rm ${pidfile}
}
run_rc_command "$1"