Skip to content

Instantly share code, notes, and snippets.

Created April 6, 2011 07:44
What would you like to do?
init-script for airvideo-server using start-stop-daemon
# create a new user called airvideo
# $ sudo adduser airvideo
# place this file in /etc/init.d/airvideo-server
# change the file permission to executable:
# $ sudo chmod +w /etc/init.d/airvideo-server
# add it to default run level
# $ sudo update-rc.d airvideo-server defaults
# Notes: make sure the folders in /opt/airvideo-server/ are readable by airvideo user
case "$1" in
echo "Starting AirVideo"
start-stop-daemon --start --quiet -b -m -p /var/run/ --chuid airvideo --exec /usr/bin/java -- -jar /opt/airvideo-server/AirVideoServerLinux.jar /opt/airvideo-server/
echo "Stopping AirVideo"
start-stop-daemon --stop --quiet --pidfile /var/run/
rm -f /var/run/airvideo-server
echo "Usage: /etc/init.d/airvideo-server {start|stop}"
exit 1
exit 0
Copy link

daluu commented May 4, 2016

Should that be chmod +x in the comments section instead of chmod +w?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment