summaryrefslogtreecommitdiff
path: root/sysutils/goss/files/goss.in
blob: 65507578b06434eb14a32dd62a6ea4a2d2318b53 (plain) (blame)
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
35
36
#!/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"