#!/bin/sh

# PROVIDE: punjab
# REQUIRE: DAEMON

. /etc/rc.subr

name="punjab"
rcvar=punjab_enable
command="%%PREFIX%%/bin/twistd"

load_rc_config $name

punjab_enable=${punjab_enable-"NO"}
punjab_uid=${punjab_uid-"65534"}
punjab_gid=${punjab_gid-"65534"}
punjab_logfile=${punjab_logfile-"/var/log/punjab.log"}
punjab_pidfile=${punjab_pidfile-"/var/run/punjab.pid"}
punjab_tac=${punjab_tac-"%%PREFIX%%/libexec/punjab.tac"}

command_interpreter="%%PYTHON_CMD%%"
pidfile=${punjab_pidfile}

command_args="-u ${punjab_uid} -g ${punjab_gid} --pidfile ${pidfile} -l ${punjab_logfile} -y ${punjab_tac}"

run_rc_command "$1"
