# ices web API server runner
# see init(5) for details

description "ardj web API"
author "Justin Forest <hex@umonkey.net>"

script
	export PATH=/home/radio/bin:/home/radio/ardj/bin:$PATH

	if [ -f /var/run/ardj-server.pid ]; then
		sleep 5
		rm -f /var/run/ardj-server.pid
	fi

	exec start-stop-daemon --start --quiet --chuid radio --umask 0002 \
		--make-pidfile --pidfile /var/run/ardj-server.pid \
		--exec /home/radio/ardj/bin/ardj -- serve
end script

start on filesystem
stop on runlevel [06]

respawn
