Added init.d and systemd service files.

This commit is contained in:
Thulinma 2014-03-12 14:02:59 +01:00
parent d519a8f6a0
commit 0b3dc1f3ba
2 changed files with 58 additions and 0 deletions

46
mistserver.init Normal file
View file

@ -0,0 +1,46 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: mistserver
# Required-Start: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: MistServer service
# Description: MistServer - next generation multimedia server
### END INIT INFO
#
# Function that starts the daemon/service
#
do_start()
{
MistController -d -L /var/log/mistserver.log -c /etc/mistserver.conf
}
#
# Function that stops the daemon/service
#
do_stop()
{
killall MistController
}
case "$1" in
start)
echo "Starting MistServer"
do_start
;;
stop)
echo "Stopping MistServer"
do_stop
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
sleep 2
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 3
;;
esac

12
mistserver.service Normal file
View file

@ -0,0 +1,12 @@
[Unit]
Description=MistServer
After=networkmanager.service
[Service]
Type=simple
ExecStart=/usr/bin/MistController -c /etc/mistserver.conf
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target