execute throuth ssh without hanging

`ssh root@192.168.1.100 "service jetty restart"` will not exit after start.
https://github.com/eclipse/jetty.project/pull/36

Signed-off-by: btpka3 <btpka3@163.com>
This commit is contained in:
btpka3 2015-01-30 12:15:27 +08:00 committed by Greg Wilkins
parent 6492ef7c78
commit e571108030
1 changed files with 2 additions and 2 deletions

View File

@ -457,11 +457,11 @@ case "$ACTION" in
chown "$JETTY_USER" "$JETTY_PID"
# FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc.
su - "$JETTY_USER" $SU_SHELL -c "
exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" &
exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" > /dev/null &
disown \$!
echo \$! > '$JETTY_PID'"
else
"${RUN_CMD[@]}" &
"${RUN_CMD[@]}" > /dev/null &
disown $!
echo $! > "$JETTY_PID"
fi