SPICEFILE="$STATE_DIR/spice"
LOGFILE="$LOG_DIR/qemu"
SPICELOG="$LOG_DIR/spice"
+ XPRALOG="$LOG_DIR/xpra"
if [ -e "$STORAGE/ssh/$VM.key" ]; then
mkdir -p "$STORAGE/ssh"
logs="$logs $SPICELOG"
fi
+ if [ -s "$XPRALOG" ]; then
+ logs="$logs $XPRALOG"
+ fi
+
tail -F $logs
}
local action="$3"
shift 3
+ SSH="`cat $SSHFILE`"
+
if [ -z "$action" ]; then
action="start"
fi
- SSH="`cat $SSHFILE`"
- xpra $action --ssh="$SSH_COMMAND -p $SSH" ssh:$SSH_LOGIN@127.0.0.1 $*
+ if [ "$action" == "start" ] || [ "$action" == "attach" ]; then
+ nohup xpra $action --ssh="$SSH_COMMAND -p $SSH" ssh:$SSH_LOGIN@127.0.0.1 $* &> $XPRALOG < /dev/null &
+ else
+ xpra $action --ssh="$SSH_COMMAND -p $SSH" ssh:$SSH_LOGIN@127.0.0.1 $*
+ fi
}
# Alias for up command