Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Functions in system init scripts
- X-seq: zsh-users 13343
- From: Daniel Qarras <dqarras@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Functions in system init scripts
- Date: Fri, 17 Oct 2008 13:17:11 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=lk9+2CYPW+FZFWsxxwMiV+6/J1i7ZqEK/bydM1N1yiESNi2QytIKnnmy76hANMtCkirlm3zRp6rgxOGmk90zW7spxZhePkRQ1TEAkGtnW6vkCDiV9TcVgYkMKazaW8kpQwT43f0NfPG/XsUk3M9Qgxj3/02cqAZ6aFD3DPg2cG0=;
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: dqarras@xxxxxxxxx
Hi all,
I guess this an age old problem but it bit me again after few years hiatus. Probably most compactly described by this screenshot from gnome-terminal:
localhost:~> cat /etc/profile.d/functest.sh
functest ()
{
echo function functest defined
}
FUNCVAR=1
export FUNCVAR
localhost:~> echo $FUNCVAR
1
localhost:~> which functest
functest not found
zsh: exit 1
localhost:~> . /etc/profile.d/functest.sh
localhost:~> which functest
functest () {
echo function functest defined
}
What happens here is that some applications install their initialization scripts under /etc/profile.d and those get sourced via /etc/profile when a user logins (and /etc/profile is sourced by /etc/zprofile). With console sessions or ssh connections all is good.
When a user is logging via a display manager like GDM, the function definitions get "lost" as only zshenv/.zshenv/zshrc/.zshrc are getting sourced when an xterm / gnome-terminal is launched. zprofile/.zprofile are sourced during the login but only environment variable setting survive till xterm/gnome-terminal.
So the question is what would be the most optimal way to fix this? Some distributions' zsh package (e.g., Red Hat's) actually source init scripts under /etc/profile.d *twice* but that raises new problems as then a user will have hard time to override some settings in his own init scripts (and it just feel broken to do something like that twice in any case).
Thanks!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author