jellyfin-server/debian/jellyfin.init
Joshua M. Boniface a73d255f51 Enable self-contained binary mode (#160)
* Build self-contained Debian linux-x64 binary

* Update initscripts to use self-contained binary

The binary is declared in the units intentionally rather than using
the variable extrapolation from before, to avoid confusion since
these can't really be moved reasonably.

* With combined binary name, use pgrep instead

* Remove dotnet-runtime dependency

* Move the compiled scb to usr/bin

* Update binary location for upstart/systemd

* Move binary path; fix pidfile handling

* Entirely remove the temporary usr/ dir

* Don't move the compiled binary

* Create /usr/bin symlink

* Use the variable here

* Update architecture to any

* Add libcurl4-openssl build dependency

* Update the build Dockerfile to install builddeps
2018-12-14 21:21:48 -05:00

50 lines
1.2 KiB
Plaintext

### BEGIN INIT INFO
# Provides: Jellyfin Media Server
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jellyfin Media Server
# Description: Runs Jellyfin Server
### END INIT INFO
# Carry out specific functions when asked to by the system
pidfile="/var/run/jellyfin.pid"
pid=`cat $pidfile`
case "$1" in
start)
if [ "$pid" == "" ]; then
echo "Starting Jellyfin..."
. /etc/default/jellyfin
nohup su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS
echo ?? > $pidfile
else
echo "Jellyfin already running"
fi
;;
stop)
if [ "$pid" != "" ]; then
echo "Stopping Jellyfin..."
kill $pid
sleep 2
rm -f $pidfile
else
echo "Jellyfin not running"
fi
;;
status)
if [ "$pid" != "" ]; then
echo "Jellyfin running as $pid"
ps -f $pid
else
echo "Jellyfin is not running"
fi
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac