summaryrefslogtreecommitdiff
path: root/.app/lib/pid-method
diff options
context:
space:
mode:
Diffstat (limited to '.app/lib/pid-method')
-rwxr-xr-x.app/lib/pid-method14
1 files changed, 8 insertions, 6 deletions
diff --git a/.app/lib/pid-method b/.app/lib/pid-method
index 55d74b8..29f6b4f 100755
--- a/.app/lib/pid-method
+++ b/.app/lib/pid-method
@@ -2,12 +2,13 @@
set -u
-PID_FILE=$APPSH_APPS/.app/var/pid/$APPSH_NAME-$APPSH_INSTANCE.pid
-
. $APPSH_HOME/.app/lib/app-conf
+pid_file=$APPSH_APPS/.app/var/pid/$APPSH_NAME-$APPSH_INSTANCE.pid
bin=`get_conf $APPSH_APPS $APPSH_NAME $APPSH_INSTANCE app.bin`
+cd $APPSH_APPS/$APPSH_NAME/$APPSH_INSTANCE/current
+
if [ -z "$bin" ]
then
echo "Missing required configuration: app.bin." >&2
@@ -23,9 +24,9 @@ fi
chmod +x "$bin"
PID=
-if [ -r $PID_FILE ]
+if [ -r $pid_file ]
then
- PID="`cat $PID_FILE`"
+ PID="`cat $pid_file`"
fi
do_status() {
@@ -51,9 +52,10 @@ method_start() {
esac
$bin <&- 1<&- 2<&- &
+
PID=$!
echo "Application launched as $PID"
- echo $PID > $PID_FILE
+ echo $PID > $pid_file
return 0
}
@@ -83,7 +85,7 @@ method_stop() {
done
echo " OK"
- rm -f $PID_FILE
+ rm -f $pid_file
return 0
}