blob: d78177158c260ea5f7e17a9c6b7ee7f09c788e7c (
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
|
#!/bin/sh
#
# PROVIDE: nats
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to run NATS:
#
# nats_enable (bool): Set it to "YES" to enable nats server.
# Default is "NO".
# nats_user: User name to run as. default "nobody"
# nats_options: Options to pass nats server
#
. /etc/rc.subr
name=nats
rcvar=`set_rcvar`
load_rc_config ${name}
: ${nats_enable:=NO}
: ${nats_user:=nobody}
: ${nats_options="-c %%PREFIX%%/etc/nats.conf"}
command=/usr/sbin/daemon
procname=%%PREFIX%%/bin/nats-server
command_args="${procname} ${nats_options}"
run_rc_command "$1"
|