Make init scripts Python version agnostic

Now that the Tautulli will run on both major versions of Python we can 
remove the specificity in the init scripts and make them simpler, with 
the added advantage that some OS's will now run Tautulli through Python 
3 instead of Python 2.
This commit is contained in:
Landon Abney
2020-03-28 16:31:14 -07:00
parent 155b98bb0c
commit 4edd2001b3
5 changed files with 9 additions and 13 deletions

View File

@@ -21,8 +21,8 @@ datadir=/opt/Tautulli
configfile=/opt/Tautulli/config.ini
pidfile=/var/run/tautulli.pid
nice=
# The following line must point to your Python 2.7 install
python27=/usr/src/Python-2.7.11/python
# The following line must point to your Python installation
python=/usr/bin/python
##
options=" --daemon --config $configfile --pidfile $pidfile --datadir $datadir --nolaunch --quiet"
@@ -30,7 +30,7 @@ options=" --daemon --config $configfile --pidfile $pidfile --datadir $datadir --
start() {
# Start daemon.
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile $nice $python27 $homedir/Tautulli.py $options
daemon --pidfile=$pidfile $nice $python $homedir/Tautulli.py $options
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
@@ -39,7 +39,7 @@ start() {
stop() {
echo -n $"Shutting down $prog: "
killproc -p $pidfile $python27
killproc -p $pidfile $python
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile

View File

@@ -51,7 +51,7 @@ verify_tautulli_pid() {
# Make sure the pid corresponds to the Tautulli process.
if [ -f ${tautulli_pid} ]; then
pid=`cat ${tautulli_pid} 2>/dev/null`
ps -p ${pid} | grep -q "python2 ${tautulli_dir}/Tautulli.py"
ps -p ${pid} | grep -q "python ${tautulli_dir}/Tautulli.py"
return $?
else
return 0

View File

@@ -51,7 +51,7 @@ verify_tautulli_pid() {
# Make sure the pid corresponds to the Tautulli process.
if [ -f ${tautulli_pid} ]; then
pid=`cat ${tautulli_pid} 2>/dev/null`
ps -p ${pid} | grep -q "python2 ${tautulli_dir}/Tautulli.py"
ps -p ${pid} | grep -q "python ${tautulli_dir}/Tautulli.py"
return $?
else
return 0