Description of problem: If this file is not executed, the environment is not quite correct. For instance, gnome-terminal will not pick up language settings. Version-Release number of selected component (if applicable): xrdp-0.5.0-0.6.20090811cvs.fc12.i686 How reproducible: Always. Steps to Reproduce: 1. Run xrdp. Actual results: Environment different from regular Gnome session. Expected results: Environment should match the one from a regular Gnome session. Additional info: --- /etc/xrdp/startwm.sh.o 2009-09-17 05:39:53.000000000 +1000 +++ /etc/xrdp/startwm.sh 2010-07-06 15:24:49.132095018 +1000 @@ -10,6 +10,13 @@ #PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" #export PATH=$PATH +if [ -f /etc/profile ]; then + . /etc/profile +fi +if [ -f ~/.bash_profile ]; then + . ~/.bash_profile +fi + for WindowManager in $SESSIONS do which $WindowManager
Simpler fix: diff -u /etc/xrdp/startwm.sh.o /etc/xrdp/startwm.sh --- /etc/xrdp/startwm.sh.o 2009-09-17 05:39:53.000000000 +1000 +++ /etc/xrdp/startwm.sh 2010-07-06 16:50:45.926245031 +1000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash -l # change the order in line below to run to run whatever window manager you # want, default to kde
(In reply to comment #1) > -#!/bin/sh > +#!/bin/bash -l ok, I will apply it, thanks for the report. In fedora sh is a symlink to bash, do you know which others operating systems where sh is not bash ?
Any Unix (e.g. Solaris) will generally have a non-bash default shell. At least that's how I remember it :-)
xrdp-0.5.0-0.10.03172010.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/xrdp-0.5.0-0.10.03172010.fc12
xrdp-0.5.0-0.10.03172010.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/xrdp-0.5.0-0.10.03172010.fc13
Invoking /bin/sh -l instead of /bin/bash -l will produce a slightly different result. Instead of calling ~/.bash_profile, ~/.profile will be called. Most people will likely have ~/.bash_profile in their home directories on Fedora (because that would have gotten copied from /etc/skel on account setup). ~/.bash_profile calls /etc/bashrc, which also does some setup (such as umask).
xrdp-0.5.0-0.10.03172010.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update xrdp'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/xrdp-0.5.0-0.10.03172010.fc13
xrdp-0.5.0-0.10.03172010.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update xrdp'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/xrdp-0.5.0-0.10.03172010.fc12
Another problem about startwm.sh. With xrdp, it does start up any Input Method, such as SCIM. Maybe we should call /etc/X11/xinit/xinitrc instead of start a Window Manager by startwm.sh itself.
xrdp-0.5.0-0.11.03172010.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/xrdp-0.5.0-0.11.03172010.fc14
xrdp-0.5.0-0.11.03172010.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/xrdp-0.5.0-0.11.03172010.fc13
xrdp-0.5.0-0.11.03172010.fc13.1 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/xrdp-0.5.0-0.11.03172010.fc13.1
(In reply to comment #9) > Another problem about startwm.sh. > With xrdp, it does start up any Input Method, such as SCIM. > Maybe we should call /etc/X11/xinit/xinitrc instead of start a Window Manager > by startwm.sh itself. what do you think about putting this #!/bin/sh . /etc/X11/xinit/xinitrc in startwm.sh ?
I think you should call call profile and something misc before xinitrc.
xrdp-0.5.0-0.10.03172010.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
xrdp-0.5.0-0.11.03172010.fc13.1 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
xrdp-0.5.0-0.11.03172010.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
Again a problem in F-14 with the latest update. Path is incorrect inside xrdp session, because startwm.sh is not run under a login shell. The file /etc/X11/xinit/xinitrc is found when xorg-x11-xinit is installed (which will mostly be the case, because without this gdm cannot be there). You need to execute that pre_start function before calling xinitrc, otherwise the environment doesn't get set up right.
(In reply to comment #18) > You need to execute that pre_start function before calling xinitrc, otherwise > the environment doesn't get set up right. Actually, that doesn't work either. Digging...
(In reply to comment #19) > Actually, that doesn't work either. Digging... Changing the shell to login shell does (i.e. what I did in comment #1). I get correct paths set up once again.
Created attachment 469292 [details] Have correct environment, even when using xinitrc
(In reply to comment #19) > Actually, that doesn't work either. Digging... That would be because I'm an idiot. Functions need to be defined before they are used in shell. See the patch.
Moving this to F-15. Any chance we see this patched up?
yes, I will do it.
Still a problem in F-16. Moving to that.
It's a pam configuration issue. sesman has it's own pam configuration. It's not set up to read the environment on login, as it's not required per the configuration. At some point in the sesman pam configuration, `pam_env.so` needs to be 'required'. Probably as part of session or auth.
Moving to F-17. Will attach a patch that would fix this trivially in the xrdp.spec file.
Created attachment 586502 [details] Have correct environment, even when using xinitrc Instead of changing startwm.sh, we can simply execute it form another, bash specific script, with environment already set. This would be Fedora specific, so no need to push anything upstream, where bash may not be available etc.
xrdp-0.6.0-0.5.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/xrdp-0.6.0-0.5.fc17
Package xrdp-0.6.0-0.5.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing xrdp-0.6.0-0.5.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-8538/xrdp-0.6.0-0.5.fc17 then log in and leave karma (feedback).
xrdp-0.6.0-0.5.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.