mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Merged with upstream.
This commit is contained in:
commit
a9c853e5bd
16 files changed
+186
-77
No files matched your search
+2
-21
@@ -7,21 +7,17 @@
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: plinth web frontend
|
||||
# Description:
|
||||
# Control the exmachina privileged execution daemon and the plinth
|
||||
# web frontend.
|
||||
# Control the plinth web frontend.
|
||||
### END INIT INFO
|
||||
|
||||
# This file is /etc/init.d/plinth
|
||||
DAEMON=/usr/local/bin/plinth.py
|
||||
EXMACHINA_DAEMON=/usr/local/bin/exmachina.py
|
||||
PID_FILE=/var/run/plinth.pid
|
||||
EXMACHINA_PID_FILE=/var/run/exmachina.pid
|
||||
|
||||
PLINTH_USER=www-data
|
||||
PLINTH_GROUP=www-data
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
test -x $EXMACHINA_DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
@@ -31,17 +27,9 @@ start_plinth (){
|
||||
if [ -f $PID_FILE ]; then
|
||||
echo Already running with a pid of `cat $PID_FILE`.
|
||||
else
|
||||
if [ -f $EXMACHINA_PID_FILE ]; then
|
||||
echo exmachina was already running with a pid of `cat $EXMACHINA_PID_FILE`.
|
||||
kill -15 `cat $EXMACHINA_PID_FILE`
|
||||
rm -rf $EXMACHINA_PID_FILE
|
||||
fi
|
||||
SHAREDKEY=`$EXMACHINA_DAEMON --random-key`
|
||||
touch $PID_FILE
|
||||
chown $PLINTH_USER:$PLINTH_GROUP $PID_FILE
|
||||
echo $SHAREDKEY | $EXMACHINA_DAEMON --pidfile=$EXMACHINA_PID_FILE --group=$PLINTH_GROUP || rm $PID_FILE
|
||||
sleep 0.5
|
||||
echo $SHAREDKEY | sudo -u $PLINTH_USER -g $PLINTH_GROUP $DAEMON --pidfile=$PID_FILE
|
||||
sudo -u $PLINTH_USER -g $PLINTH_GROUP $DAEMON --pidfile=$PID_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -53,13 +41,6 @@ stop_plinth () {
|
||||
else
|
||||
echo "No pid file at $PID_FILE suggests plinth is not running."
|
||||
fi
|
||||
if [ -f $EXMACHINA_PID_FILE ]; then
|
||||
kill -15 `cat $EXMACHINA_PID_FILE` || true
|
||||
rm -rf $EXMACHINA_PID_FILE
|
||||
echo "killed exmachina"
|
||||
else
|
||||
echo "No pid file at $EXMACHINA_PID_FILE suggests exmachina is not running."
|
||||
fi
|
||||
}
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
Reference in new issue
Block a user