Le dimanche 23 juin 2013 21:21:31, Thomas Preud'homme a écrit :
> Le dimanche 23 juin 2013 18:52:24, Thomas Preud'homme a écrit :
> > Le dimanche 23 juin 2013 18:43:14, Osamu Aoki a écrit :
> > > On Sun, Jun 23, 2013 at 05:17:56PM +0200, Thomas Preud'homme wrote:
> > > > > It seems that 20_ibus.rc is ultimately sourced by the user's shell.
> > > 
> > > Really?  Why?
> > 
> > I don't know, as said I didn't manage to track down the cause. Maybe I'm
> > wrong and it's executed by sh but the ls was not working on my system
> > (the loop was not entered) exactly like zsh would. I assumed it was
> > because the script is run at some point by zsh but I might be wrong and
> > maybe dash act differently when sourcing something than when run in
> > interactive mode (I made my debugging with dash in interactive mode).
> 
> Ok, it seems it's kdm's fault. If you look at the file
> /etc/kde4/kdm/Xsession, you'll see that it test what is the shell (which
> suggests that this file is not executed but sourced, despite the shebang)
> and at the end it source /etc/X11/Xsession. I couldn't find where is
> /etc/kde4/kdm/Xsession sourced yet but to me it seems it's sourced and
> then it source Xsession which eventually sources 20_ibus.rc.

Sorry for the spam but I just found it. It was just in front of me. 
/etc/kde4/kdm/Xsession contains the following excerpt:

case $SHELL in
[SNIP bash case]
  */zsh)
    [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
    emulate -R zsh

I've seen several occurences in kdm's code to set the SHELL environment 
variable. So later Xsession is executed, $SHELL is detected to be zsh so it 
exec zsh /etc/kde4/kdm/Xsession $otherargs which set zsh to zsh emulation mode 
and then source /etc/X11/Xsession. I suppose the bug could be fixed by setting 
zsh to sh emulate mode.

> 
> I let it up to you to reassign to kdm, in which case the patch tags ought
> to be removed.

Let me know if you want me to do it instead.

Best regards,

Thomas

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to