FS#8946 - zsh is missing profiles

Attached to Project: Arch Linux
Opened by Pierre Schmitz (Pierre) - Sunday, 16 December 2007, 18:14 GMT
Last edited by Pierre Schmitz (Pierre) - Friday, 16 May 2008, 13:16 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jeff Mickey (codemac)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When setting zsh as default shell for a user the /etc/profile script and no script in /etc/profile.d are executed. Esspecially when using an utf8 layout you will not be able to type or read non-ascii chars.

A woraround is to create symlinks from /etc/profile to /etc/zsh/zprofile and from /etc/profile.d to /etc/zprofile.d.

This task depends upon

Closed by  Pierre Schmitz (Pierre)
Friday, 16 May 2008, 13:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  I fixed the problem in kdm
Comment by Jeff Mickey (codemac) - Wednesday, 19 December 2007, 21:47 GMT
We can't create symlinks just on install of zsh though, what if a user wants to have users with 2 different default shells?
Comment by Calogero Lo Leggio (kalos) - Thursday, 20 December 2007, 15:55 GMT
Another way to solve this issue is removing '--enable-etcdir=/etc/zsh' option in zsh's PKGBUILD.

This allows zsh to read correctly the /etc/profile




Comment by Pierre Schmitz (Pierre) - Monday, 31 December 2007, 14:03 GMT
Removing this option solves the problem for me. One should review the other etc-options, too. In addition to this it might be a good idea to explicitly enable multibyte support.

But another problem is that /etc/profile uses some bash-specific stuff (like PS1,2)
Comment by Pierre Schmitz (Pierre) - Tuesday, 01 January 2008, 10:30 GMT
I have to revert my last comment. This does not work for xterms. If you start a xterm you'll get a broken locale. But if you start another xterm from there the second one will work. So I would assume that some vars have to be set before xterm is starting which cannot be achieved with the "fix" mentioned above.

So why not got with the symlinks? It would not break anything.
Comment by Xavier (shining) - Tuesday, 01 January 2008, 18:23 GMT
Afaik, most terms have a login shell mode.
Kde, gnome and xfce terms have an option in their gui iirc.
And for urxvt and xterm, I have these two lines in ~/.Xdefaults :
urxvt*loginShell: true
xterm*loginShell: true

I just wanted to mention this because that's what I use and it works fine for me.
Comment by Xavier (shining) - Wednesday, 12 March 2008, 18:54 GMT
When I use a real login shell, it works fine too. And then if I start a X session from a login shell, the options are inherited, so I actually don't even need that loginShell option.
I don't understand what is wrong, zsh loads /etc/profile just fine here..
Comment by Jeff Mickey (codemac) - Wednesday, 12 March 2008, 19:03 GMT
I've updated zsh, and I've not removed the /etc/zsh lines.

So far all I've seen is that people aren't running login shells when they want one..
Comment by enderst (enderst) - Saturday, 29 March 2008, 18:51 GMT
codemac, seems you're missing a couple lines in your pkgbuild

mkdir -p $startdir/pkg/etc/zsh
install -D -m 755 $startdir/zprofile $startdir/pkg/etc/zsh/zprofile
Comment by Xavier (shining) - Saturday, 29 March 2008, 19:00 GMT Comment by enderst (enderst) - Saturday, 29 March 2008, 19:32 GMT
hmm k
it is included with the build files from abs, so i thought it was a mistake that it didn't get installed.

so wouldn't '--enable-zprofile=/etc/profile \' be a better option than
'--enable-zprofile=/etc/zsh/zprofile \' ?
or maybe 'echo ">> link /etc/profile to /etc/zsh/zprofile" in the post_install
Comment by Xavier (shining) - Saturday, 29 March 2008, 19:36 GMT
well if you look at that cvs link, there is also :
--enable-zprofile=/etc/profile \
in the new version
Comment by Greg (dolby) - Sunday, 04 May 2008, 19:23 GMT
could this considered solved? also i would suggest ditching usr_zsh.sh too with the next upgrade. it is far too old to be useful
Comment by enderst (enderst) - Monday, 05 May 2008, 00:51 GMT
might add a link to the zsh wiki entry, since zsh won't read files in /etc/profile.d/ without the entry below in ~/.zshrc
---------
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then
for profile in /etc/profile.d/*.sh; do
if [ -x $profile ]; then
. $profile
fi
done
unset profile
fi
-----------
Comment by Xavier (shining) - Monday, 05 May 2008, 07:15 GMT
Just because one month passed don't give you the right to ignore everything that was said. Again, zsh is built with --enable-zprofile=/etc/profile so profile is sourced when you use a login shell.
If you don't use a login shell at any point when starting your working environment, that's your problem, so fix it.
For example, you might be using a broken login manager like kdm which assumes that zsh profile is in /etc/zprofile. You can work around that issue by making a zprofile symlink manually. But that's an issue with kdm, not zsh.
And if you are going to hack it like above, then just do source /etc/profile in your .zshrc instead of duplicating everything.

Loading...