Update of /cvsroot/freevo/freevo
In directory sc8-pr-cvs1:/tmp/cvs-serv30560

Modified Files:
        freevo 
Log Message:
Don't start if there's already one running.  Workes with 'execute' too.


Index: freevo
===================================================================
RCS file: /cvsroot/freevo/freevo/freevo,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** freevo      7 Jun 2003 22:24:13 -0000       1.51
--- freevo      7 Jun 2003 23:01:32 -0000       1.52
***************
*** 85,88 ****
--- 85,99 ----
      APP=`basename $1`
      PID_FILE=$PID_DIR/freevo-$APP.pid
+ 
+     # Exit if there is one already running
+     if [ -f $PID_FILE ] ; then
+         PID=`cat $PID_FILE`
+         RUNNING=`ps -ef | grep $PID | grep -v grep`
+         if ! [ "$RUNNING" = "" ] ; then
+           echo "Freevo's $APP is already running as process $PID."
+           exit 0
+         fi
+     fi
+ 
      trap './freevo stop $APP' 1 2 15
      ./runapp python $@ &
***************
*** 106,112 ****
  fi
  
! # Start the main freevo application
  PID_FILE=$PID_DIR/freevo-main.pid
  trap './freevo stop' 1 2 15
  ./runapp python src/main.py $@ &
  echo $! > $PID_FILE
--- 117,134 ----
  fi
  
! # Exit if there is a Freevo still running
  PID_FILE=$PID_DIR/freevo-main.pid
+ if [ -f $PID_FILE ] ; then
+     PID=`cat $PID_FILE`
+     RUNNING=`ps -ef | grep $PID | grep -v grep`
+     if ! [ "$RUNNING" = "" ] ; then
+       echo "Freevo is already running as process $PID."
+       exit 0
+     fi
+ fi
+ 
  trap './freevo stop' 1 2 15
+ 
+ # Start the main freevo application
  ./runapp python src/main.py $@ &
  echo $! > $PID_FILE




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to