From edc02316f465cfb073ca706910518dc4dea37cd7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 1 Apr 2017 17:54:28 -0300 Subject: Adds xpra log file --- kvmx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kvmx b/kvmx index 54f72fb..ef07434 100755 --- a/kvmx +++ b/kvmx @@ -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 -- cgit v1.2.3