ports/sysutils/goss/files/goss.in
Steve Wills bb37306ddc sysutils/goss: Add rc script, sample configuration
PR:		221579
Submitted by:	Mike English <englishm@llnw.com> (maintainer)
2017-08-17 14:35:52 +00:00

36 lines
931 B
Bash

#!/bin/sh
# Goss startup script
#
# PROVIDE: goss
# REQUIRE: DAEMON
# KEYWORD: shutdown
# Add the following to /etc/rc.conf[.local] to enable this service
#
# goss_enable (bool): Set to NO by default.
# Set it to YES to enable goss
# goss_conf (string): Set to %%PREFIX%%/etc/goss.yaml by default
# Set it to preferred config file
# goss_listen (string): Set to ":12345" by default
# Set it to preferred listen address
#
. /etc/rc.subr
name=goss
rcvar=goss_enable
load_rc_config $name
: ${goss_enable:="NO"}
: ${goss_listen="127.0.0.1:12345"}
: ${goss_conf="%%PREFIX%%/etc/goss.yaml"}
required_files=${goss_conf}
pidfile=/var/run/${name}.pid
procname="%%PREFIX%%/bin/goss"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} /usr/bin/env ${goss_env} ${procname} -g ${goss_conf} serve -l ${goss_listen}"
run_rc_command "$1"