From 83c13f1181c4062ca5296ea956e950064bde0ffe Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 18 Oct 2012 13:38:58 +0200 Subject: o Making all scripts be run from the root/ directory. Do not assume you're in current/. --- .app/lib/pid-method | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.app/lib/pid-method') 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 } -- cgit v1.2.3