[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#604010: x11-common: xsession should use $SHELL and not sh directly

Vincent Lefevre <vincent@vinc17.net> - Tue, 15 Feb 2011 12:17:25 +0100

>On 2011-02-12 12:58:46 +0100, Cyril Brulebois wrote:
>> Hi Michel,
>> Michel Briand <michelbriand@free.fr> (19/11/2010):
>> > 50x11-common_determine-startup SHOULD not use "sh $STARTUPFILE"
>> I've just replaced that with:
>> +          shell=${SHELL:-sh}
>> +          STARTUP="$shell $STARTUPFILE"
>> which should do what you want.
>I think this change should be reverted, as this may break existing
>scripts. The .xsession file has always been described as a Bourne
>shell (sh(1)) script (see Xsession(5) man page), and if the user
>has a $SHELL not compatible with sh(1), typically zsh, the script
>may no longer run correctly.
>Moreover I think this is a misuse of the SHELL environment variable,
>which is there to run simple commands (for which the shell can only
>be provided by external information), not full scripts.

I don't think $SHELL is only there to run simple commands. IIRC the
$SHELL variable is set after the value in /etc/passwd (or whatever
account mgt system) and represent the preferred shell and what we can
refer as the "login shell". 

If I setup my profile in .bash_profile, for example, I'd like to
have it loaded during X session. If sh is used instead then all child
processes of the session will not have profile variables set up. This
could be very annoying.

Reply to: