I've created start scripts for bittorrent tracker. I think they may be of use.
# cat /etc/init.d/bittorrent-tracker #!/sbin/runscript opts="start stop restart" depend() { need net } start() { result=0 ebegin "Starting bittorrent tracker" if [ ! -d ${BASEDIR}/${SUBDIR} ] then einfo "Directory ${BASEDIR}/${SUBDIR} not existing, trying to create..." if [ ! -d ${BASEDIR} ] then mkdir -p ${BASEDIR} chown ${USER}:users ${BASEDIR} if [ ! -d ${BASEDIR} ] then eerror "Directory ${BASEDIR} could not be created!" result=$(( ${result} + 1 )) fi fi su ${USER} -c "mkdir ${BASEDIR}/${SUBDIR}" if [ ! -d ${BASEDIR}/${SUBDIR} ] then eerror "Directory ${BASEDIR}/${SUBDIR} could not be created!" result=$(( ${result} + 1 )) fi einfo "...ok!" fi cd ${BASEDIR}/${SUBDIR}/ env HOME=${BASEDIR} start-stop-daemon --quiet --start -c ${USER} \ -p /var/run/bittorrent-tracker.pid -m \ --nicelevel ${NICE} -x /usr/bin/bittorrent-tracker -- --port ${PORT} --dfile ${BASEDIR}/${SUBDIR}/dfile --logfile ${LOG} &>${LOG} & sleep 5 if ! pgrep -u ${USER} -f "/usr/bin/python /usr/bin/bittorrent-tracker" >/dev/null then eerror "bittorrent-tracker could not be started! Check logfile: ${LOG}" result=$(( ${result} + 1 )) fi eend $result } stop() { start-stop-daemon --stop -p /var/run/bittorrent-tracker.pid &>/dev/null local ret=$? eend ${ret} "Failed to stop bittorrent-tracker" rm -f /var/run/bittorrent-tracker.pid return ${ret} eend $? } restart() { svc_stop sleep 5 svc_start }
we already have start script for bittorrent tracker. it's called bttrack