aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-05-15 21:07:02 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-05-15 21:07:02 +0200
commitfcf675a21506e614661b641941d14a4470f1e2f6 (patch)
tree07aee0d271524068ee4cedf847d10008166eb78e
parent35136a693c89653c8bdedf58722bcddb9fe2d044 (diff)
downloaddesktop-autoloader-fcf675a21506e614661b641941d14a4470f1e2f6.zip
desktop-autoloader-fcf675a21506e614661b641941d14a4470f1e2f6.tar.gz
desktop-autoloader-fcf675a21506e614661b641941d14a4470f1e2f6.tar.bz2
X11VNC debugging: Add support to observed autoloaded sessions via VNC (needs to be enabled specifically).
-rwxr-xr-xbin/desktop-autoloader19
-rw-r--r--contrib/desktop-autoloader.default6
2 files changed, 24 insertions, 1 deletions
diff --git a/bin/desktop-autoloader b/bin/desktop-autoloader
index 0ab6390..5a3856c 100755
--- a/bin/desktop-autoloader
+++ b/bin/desktop-autoloader
@@ -25,6 +25,9 @@ REQUIRED_MEMORY_THRESHOLD=2048
AUTOLOAD_DISPLAY=":20"
DESKTOP_SESSION_MANAGER="x-session-manager"
+DEBUG_X11VNC_ENABLE=false
+DEBUG_X11VNC_RFBPORT=5910
+
test -f /etc/default/desktop-autoloader && . /etc/default/desktop-autoloader
function is_true() {
@@ -66,8 +69,22 @@ if ! type -p "${DESKTOP_SESSION_MANAGER}" 1>/dev/null; then
fi
# launch an invisible X-Server
-Xvfb "${AUTOLOAD_DISPLAY}" &
+Xvfb ${AUTOLOAD_DISPLAY} -screen 0 1024x768x16 -cc 4 -nolisten tcp &
+XVFB_PID=$?
# launch a session inside this Xserver
export DISPLAY="${AUTOLOAD_DISPLAY}"
+
+# attach an x11vnc instance to the DISPLAY, if debugging is enabled
+if type -p x11vnc 1>/dev/null && is_true "${DEBUG_X11VNC_ENABLE}"; then
+
+ sleep 1
+ x11vnc -rfbport "${DEBUG_X11VNC_RFBPORT}" -forever -localhost &
+ X11VNC_PID=$?
+
+fi
+
STARTUP="${DESKTOP_SESSION_MANAGER}" dbus-run-session /etc/X11/Xsession
+
+kill $X11VNC_PID
+kill $XVFB_PID
diff --git a/contrib/desktop-autoloader.default b/contrib/desktop-autoloader.default
index 1921a66..8f3b435 100644
--- a/contrib/desktop-autoloader.default
+++ b/contrib/desktop-autoloader.default
@@ -15,3 +15,9 @@
# desktop environment to load (must be an available .desktop file under
# /usr/share/xsessions or (under Debian) x-session-manager.
#DESKTOP_SESSION_MANAGER=x-session-manager
+
+# Enable debugging over x11vnc (needs to be installed)
+#DEBUG_X11VNC_ENABLE=false
+
+# RFB port to listen on for x11vnc (RFB port 5910 -> VNC display :10)
+#DEBUG_X11VNC_RFBPORT=5910