gerrit.sh: detach gerrit properly

If you don't close stdin, stderr and stdout then gerrit
will keep f.ex. ssh sessions open. Not good if you want to do:
ssh <host> "./review_site/bin/gerri.sh start"

Change-Id: If2b169239fe9966b23cd847543a4f7652dd91ba6
This commit is contained in:
Ian Kumlien
2011-11-01 16:49:00 +01:00
committed by Shawn O. Pearce
parent 967eae196f
commit d66ef2d958

View File

@@ -380,12 +380,12 @@ case "$ACTION" in
chown $GERRIT_USER "$GERRIT_PID"
su - $GERRIT_USER -c "
JAVA='$JAVA' ; export JAVA ;
$RUN_EXEC $RUN_Arg1 '$RUN_Arg2' $RUN_Arg3 $RUN_ARGS &
$RUN_EXEC $RUN_Arg1 '$RUN_Arg2' $RUN_Arg3 $RUN_ARGS </dev/null >/dev/null 2>&1 &
PID=\$! ;
disown ;
echo \$PID >\"$GERRIT_PID\""
else
$RUN_EXEC $RUN_Arg1 "$RUN_Arg2" $RUN_Arg3 $RUN_ARGS &
$RUN_EXEC $RUN_Arg1 "$RUN_Arg2" $RUN_Arg3 $RUN_ARGS </dev/null >/dev/null 2>&1 &
PID=$!
type disown >/dev/null 2>&1 && disown
echo $PID >"$GERRIT_PID"