0

Good morning everyone,

I have a strange interaction problem between gvm, my .profile and lightdm on Ubuntu 14.10.

The line that gvm puts at the end of .profile looks like this:

[[ -s "/home/clh/.gvm/bin/gvm-init.sh" ]] && source "/home/clh/.gvm/bin/gvm-init.sh"

It seems that lightdm, which I guess processes .profile upon login, doesn't like that line, for a popup during the login process states

/usr/sbin/lightdm-session: 25 /home/clh/.profile: [[ not found

To me this looks like lightdm is using sh and not bash to handle the test. It also seems like this must be a recent change because I have been using the gvm - lightdm combo for several months now and I just started noticing this in the last week or so.

Anyway, I have "fixed" this by changing my .profile so that the last line, put in by gvm, now looks like:

if [ -n "$BASH_VERSION" ]; then
    [[ -s "/home/clh/.gvm/bin/gvm-init.sh" ]] && source "/home/clh/.gvm/bin/gvm-init.sh"
fi

I say "fixed" because the popup message has gone away and gvm seems to run.

But if anyone else has any better ideas, I'm all ears...

MonetsChemist
  • 165
  • 10
  • 1
    Changing `[[` to `[` in the original line would likely also have been enough. There's nothing about that usage of `[[` that requires the bash enhanced test that `[[` is. – Etan Reisner Nov 17 '14 at 19:05
  • sh doesn't like "source" either. and when I replaced the line with "test -s" and turned "source" into "." lightdm did not like whatever was in gvm-init.sh because it would start to login, flash, then give me the login screen again. – MonetsChemist Nov 18 '14 at 16:12
  • That should probably properly be guarded by a check for interactive mode more than anything else. – Etan Reisner Nov 18 '14 at 16:26
  • Just digging around in the various bits of wisdom on lightdm and other dm's and .profile vs. .xprofile vs. .xsessionrc... this is an incredibly messed-up topic area. No one seems to be able to agree on anything. Nevertheless, Etan, thanks for the comment. I guess you are correct when you say gvm-init.sh is really only applicable to interactive logins. Perhaps this isn't "thought of" since there seem to be less oportunities for non-interactive login these days (few running rsh any more etc). – MonetsChemist Nov 19 '14 at 17:48
  • So with some more looking around, I see that I was correct in surmising that lightdm uses sh to invoke .profile, see the code in /usr/sbin/lightdm-session. I will file a bug report with the gvm folks... – MonetsChemist Nov 19 '14 at 17:55

0 Answers0