Issue 966: removed pid bracketing

This commit is contained in:
Adrian Cole 2012-06-08 17:44:16 -07:00
parent 8d700e4e11
commit dcad558752
13 changed files with 23 additions and 23 deletions

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -213,7 +213,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -222,7 +222,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -193,7 +193,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -118,7 +118,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -44,7 +44,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -206,7 +206,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -176,7 +176,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -94,7 +94,7 @@ public class InitBuilder extends ScriptBuilder {
createRunScript)) createRunScript))
.put("status", .put("status",
newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"),
interpret("echo [{varl}FOUND_PID{varr}]{lf}"))) interpret("echo {varl}FOUND_PID{varr}{lf}")))
.put("stop", .put("stop",
newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill())) newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill()))
.put("start", .put("start",

View File

@ -209,7 +209,7 @@ public class InitScript extends ForwardingObject implements Statement, AcceptsSt
.put("init", newStatementList(call("default"), call(instanceName), init, createRunScript)) .put("init", newStatementList(call("default"), call(instanceName), init, createRunScript))
.put("status", .put("status",
newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"),
interpret("echo [{varl}FOUND_PID{varr}]{lf}"))) interpret("echo {varl}FOUND_PID{varr}{lf}")))
.put("stop", .put("stop",
newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill())) newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill()))
.put("start", .put("start",

View File

@ -10,7 +10,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &

View File

@ -46,7 +46,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -120,7 +120,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -44,7 +44,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -103,7 +103,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -121,7 +121,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1

View File

@ -43,7 +43,7 @@ function forget {
mkdir -p $LOG_DIR mkdir -p $LOG_DIR
findPid $INSTANCE_NAME findPid $INSTANCE_NAME
[ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && {
echo $INSTANCE_NAME already running pid [$FOUND_PID] echo $INSTANCE_NAME already running pid $FOUND_PID
return 1; return 1;
} || { } || {
nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log &
@ -193,7 +193,7 @@ END_OF_JCLOUDS_SCRIPT
status) status)
default || exit 1 default || exit 1
findPid $INSTANCE_NAME || exit 1 findPid $INSTANCE_NAME || exit 1
echo [$FOUND_PID] echo $FOUND_PID
;; ;;
stop) stop)
default || exit 1 default || exit 1