Blame SOURCES/tigervnc-xstartup.patch

8aca67
diff --git a/unix/vncserver b/unix/vncserver
8aca67
index bb4f2feb..b038dd3b 100755
8aca67
--- a/unix/vncserver
8aca67
+++ b/unix/vncserver
8aca67
@@ -58,27 +58,14 @@ $defaultXStartup
8aca67
     = ("#!/bin/sh\n\n".
8aca67
        "unset SESSION_MANAGER\n".
8aca67
        "unset DBUS_SESSION_BUS_ADDRESS\n".
8aca67
-       "OS=`uname -s`\n".
8aca67
-       "if [ \$OS = 'Linux' ]; then\n".
8aca67
-       "  case \"\$WINDOWMANAGER\" in\n".
8aca67
-       "    \*gnome\*)\n".
8aca67
-       "      if [ -e /etc/SuSE-release ]; then\n".
8aca67
-       "        PATH=\$PATH:/opt/gnome/bin\n".
8aca67
-       "        export PATH\n".
8aca67
-       "      fi\n".
8aca67
-       "      ;;\n".
8aca67
-       "  esac\n".
8aca67
-       "fi\n".
8aca67
-       "if [ -x /etc/X11/xinit/xinitrc ]; then\n".
8aca67
-       "  exec /etc/X11/xinit/xinitrc\n".
8aca67
-       "fi\n".
8aca67
-       "if [ -f /etc/X11/xinit/xinitrc ]; then\n".
8aca67
-       "  exec sh /etc/X11/xinit/xinitrc\n".
8aca67
-       "fi\n".
8aca67
-       "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
8aca67
-       "xsetroot -solid grey\n".
8aca67
-       "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
8aca67
-       "twm &\n");
8aca67
+       "/etc/X11/xinit/xinitrc\n".
8aca67
+       "# Assume either Gnome will be started by default when installed\n".
8aca67
+       "# We want to kill the session automatically in this case when user logs out. In case you modify\n".
8aca67
+       "# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should\n".
8aca67
+       "# be responsible to modify below code to avoid that your session will be automatically killed\n".
8aca67
+       "if [ -e /usr/bin/gnome-session ]; then\n".
8aca67
+       "    vncserver -kill \$DISPLAY\n".
8aca67
+       "fi\n");
8aca67
 
8aca67
 $defaultConfig
8aca67
     = ("## Supported server options to pass to vncserver upon invocation can be listed\n".