mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-14 07:43:06 +00:00
18003ee998
handling billions of messages per day. WWW: https://nsq.io PR: 216188 Submitted by: John Hixson <jhixson@gmail.com>
40 lines
602 B
Bash
40 lines
602 B
Bash
#!/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"
|