blob: 99e8d3589197a0a44a6ee546b449dafcff9f7ae2 (
plain)
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
37
38
39
|
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: nsqadmin
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable nsqadmin:
# nsqadmin_enable="YES"
# nsqadmin_args="<set as needed>"
. /etc/rc.subr
name=nsqadmin
rcvar=nsqadmin_enable
load_rc_config $name
: ${nsqadmin_enable:="NO"}
: ${nsqadmin_args:=""}
pidfile=/var/run/nsqadmin.pid
procname="%%PREFIX%%/bin/nsqadmin"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${procname} ${nsqadmin_args}"
start_precmd="nsqadmin_prestart"
nsqadmin_prestart()
{
if [ ! -d /var/db/nsq/nsqadmin ] ; then
mkdir -p /var/db/nsq/nsqadmin
fi
cd /var/db/nsq/nsqadmin
}
run_rc_command "$1"
|