We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.

annotate media-tv/emby-server/files/emby-server.init_2 @ 95:ae751affb613

reworked init and config scripts for emby server as well as location of program files
author gsnerf <gsnerf@gsnerf.de>
date Sun, 12 Apr 2015 18:27:31 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
95
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
1 #!/sbin/runscript
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
2
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
3 PIDFILE="/tmp/emby-server.pid"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
4 #EXEC="mono-service2 -d /opt/emby-server/ -m emby-server -n emby-server /opt/emby-server/MediaBrowser.Server.Mono.exe -programdata ${PROGRAMDATA}"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
5 #EXEC="/opt/emby-server/start.sh"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
6 EXEC="./MediaBrowser.Server.Mono.exe -programdata ${PROGRAMDATA} -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
7 EXEC_DIR="/opt/emby-server/"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
8 LOG_FILE="/var/log/emby-server_start.log"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
9
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
10 start() {
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
11 ebegin "Starting Emby-Server"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
12 # we are starting the service (-x):
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
13 # - in background with the given pid file (-m -p -b)
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
14 # - as a specific user (-u)
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
15 #start-stop-daemon -S -m -p $PIDFILE -b -u ${EXEC_USER} -d ${EXEC_DIR} -x ${EXEC} -1 ${LOG_FILE} -2 ${LOG_FILE}
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
16 start-stop-daemon -S -m -p $PIDFILE -b -u ${EXEC_USER} -d ${EXEC_DIR} -1 ${LOG_FILE} -2 ${LOG_FILE} -x mono -- ${EXEC}
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
17 eend $?
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
18 }
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
19
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
20 stop() {
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
21 ebegin "Stopping Emby-Server"
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
22 start-stop-daemon -K -p ${PIDFILE}
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
23 eend $?
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
24 }
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
25
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
26 restart() {
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
27 stop
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
28 sleep 3
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
29 start
ae751affb613 reworked init and config scripts for emby server as well as location of program files
gsnerf <gsnerf@gsnerf.de>
parents:
diff changeset
30 }