diff options
-rwxr-xr-x | kvmx | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -144,6 +144,7 @@ function __kvmx_initialize { 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" @@ -733,6 +734,10 @@ function kvmx_log { logs="$logs $SPICELOG" fi + if [ -s "$XPRALOG" ]; then + logs="$logs $XPRALOG" + fi + tail -F $logs } @@ -763,12 +768,17 @@ function kvmx_xpra { 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 |