Linux Daemon scripts
Posted: Thu Dec 10, 2009 5:43 pm
Serviio Daemon Start/Stop script/Conf for Linux
Im sure someone has already done this but i didnt see it on the forums so i thought i would help out the next guy.
NOTE:
Make sure you update DAEMON="/bin/serviio" to point to the serviio.sh start script. I made sym link to it but it requires more modifications.
File: /etc/conf.d/serviiod
File: /etc/init.d/serviiod
Im sure someone has already done this but i didnt see it on the forums so i thought i would help out the next guy.
NOTE:
Make sure you update DAEMON="/bin/serviio" to point to the serviio.sh start script. I made sym link to it but it requires more modifications.
File: /etc/conf.d/serviiod
- Code:
#########################################################
#- Daemon Script Configuration for Serviio Media Server
#- By Ian Laird
#- /etc/conf.d/serviiod
#########################################################
NAME="Serviio Media Server"
DAEMON="/bin/serviio" ## Update this to point at serviio_root/bin/serviio.sh
SERVICE_ACCOUNT="root" ## DON'T RUN UNDER ROOT!
File: /etc/init.d/serviiod
- Code:
#!/sbin/runscript
#########################################################
#- Daemon script for Serviio media server
#- By Ian Laird
#- /etc/init.d/serviiod
#########################################################
PIDFILE="/var/run/serviiod.pid"
DAEMON_STOP=" -stop"
[ -x $DAEMON ] || exit 0
start() {
ebegin "Starting $NAME"
start-stop-daemon --start -q -b -p $PIDFILE -m -c ${SERVICE_ACCOUNT} -x ${DAEMON}
eend $?
}
stop() {
ebegin "Stopping $NAME"
${DAEMON} -stop
start-stop-daemon --stop -p $PIDFILE
eend $?
}