#!/bin/sh # $FreeBSD: head/net/nsq/files/nsqd.in 454856 2017-11-24 23:17:50Z dbaio $ # # PROVIDE: nsqd # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable nsqd: # nsqd_enable="YES" # nsqd_args="" . /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"