else
if [ "${STDIN[0]}" == "up" ] || [ "${STDIN[0]}" == "start" ] || [ "${STDIN[0]}" == "restart" ]; then
# Process command, nohup version, stdout and stderr are redirected to a file
- nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
+ #nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
+
+ # Process command, disown version, stdout are preserved
+ #$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
+ $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
+ disown -h
sleep 1
if [ -e "$LOG_DIR/nohup" ] && [ -z "$tail" ]; then
tail="$1"
fi
sleep 1
-
- # Process command, disown version, stdout are preserved
- #$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
- #disown -h
else
$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
fi
else
if [ "${STDIN[0]}" == "up" ] || [ "${STDIN[0]}" == "start" ] || [ "${STDIN[0]}" == "restart" ]; then
# Process command, nohup version
- nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
- tail -F $LOG_DIR/nohup &
+ #nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
# Process command, disown version
#$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
- #disown -h
+ $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} < /dev/null >> $LOG_DIR/nohup 2>&1 &
+ disown -h
+
+ sleep 1
+ if [ -e "$LOG_DIR/nohup" ] && [ -z "$tail" ]; then
+ tail -F $LOG_DIR/nohup &
+ tail="$1"
+ fi
+ sleep 1
else
$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
fi
if [ ! -z "$tail" ]; then
kill $tail &> /dev/null
- rm -f $LOG_DIR/nohup
+ #rm -f $LOG_DIR/nohup
fi
}