Issue 126: started on nohup

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2361 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-12-02 08:13:28 +00:00
parent c98245a66c
commit 777202cec2
4 changed files with 20 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,20 @@
function forget {
unset FOUND_PID;
[ $# -eq 3 ] || {
abort "forget requires parameters INSTANCE_NAME SCRIPT LOG_DIR"
return 1
}
local INSTANCE_NAME="$1"; shift
local SCRIPT="$1"; shift
local LOG_DIR="$1"; shift
mkdir -p $LOG_DIR
findPid $INSTANCE_NAME
[ -n "$FOUND_PID" ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID]
} || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
findPid $INSTANCE_NAME
[ -n "$FOUND_PID" ] || abort "$INSTANCE_NAME did not start"
}
return 0
}

Binary file not shown.