From 1f27a4d85082e33039a023abf6d29cea97a96972 Mon Sep 17 00:00:00 2001 From: Fuminobu TAKEYAMA Date: Thu, 4 May 2017 10:49:57 +0900 Subject: [PATCH] startwm.sh: do not call pseudo shell code for /etc/X11/xdm/Xsession Since /etc/X11/xdm/Xsession calls user's login shell, startwm.sh should not execute the pseudo code; It causes to execute ~/.profile twice. --- sesman/startwm.sh | 68 ++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/sesman/startwm.sh b/sesman/startwm.sh index b81d3646..452917a4 100755 --- a/sesman/startwm.sh +++ b/sesman/startwm.sh @@ -1,34 +1,5 @@ #!/bin/sh -#start the window manager -wm_start() -{ - if [ -r /etc/default/locale ]; then - . /etc/default/locale - export LANG LANGUAGE - fi - - # debian - if [ -r /etc/X11/Xsession ]; then - . /etc/X11/Xsession - exit 0 - fi - - # el - if [ -r /etc/X11/xinit/Xsession ]; then - . /etc/X11/xinit/Xsession - exit 0 - fi - - # suse - if [ -r /etc/X11/xdm/Xsession ]; then - . /etc/X11/xdm/Xsession - exit 0 - fi - - xterm -} - # Execution sequence for interactive login shell - pseudocode # # IF /etc/profile is readable THEN @@ -77,6 +48,43 @@ post_start() return 0 } +#start the window manager +wm_start() +{ + if [ -r /etc/default/locale ]; then + . /etc/default/locale + export LANG LANGUAGE + fi + + # debian + if [ -r /etc/X11/Xsession ]; then + pre_start + . /etc/X11/Xsession + post_start + exit 0 + fi + + # el + if [ -r /etc/X11/xinit/Xsession ]; then + pre_start + . /etc/X11/xinit/Xsession + post_start + exit 0 + fi + + # suse + if [ -r /etc/X11/xdm/Xsession ]; then + # since the following script run a user login shell, + # do not execute the pseudo login shell scripts + . /etc/X11/xdm/Xsession + exit 0 + fi + + pre_start + xterm + post_start +} + #. /etc/environment #export PATH=$PATH #export LANG=$LANG @@ -91,8 +99,6 @@ post_start() # includes # auth required pam_env.so readenv=1 -pre_start wm_start -post_start exit 1