blob: 189c1bc69b3204cf1f1d6502bce8ad2672fd4e2a (
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: nsqd
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable nsqd:
# nsqd_enable="YES"
# nsqd_args="<set as needed>"
. /etc/rc.subr
name=nsqd
rcvar=nsqd_enable
load_rc_config $name
: ${nsqd_enable:="NO"}
: ${nsqd_args:=""}
pidfile=/var/run/nsqd.pid
procname="%%PREFIX%%/bin/nsqd"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${procname} ${nsqd_args}"
start_precmd="nsqd_prestart"
nsqd_prestart()
{
if [ ! -d /var/db/nsq/nsqd ] ; then
mkdir -p /var/db/nsq/nsqd
fi
cd /var/db/nsq/nsqd
}
run_rc_command "$1"
|