Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Functions in system init scripts



Hi Daniel,

On Fri, Oct 17, 2008 at 22:17, Daniel Qarras <dqarras@xxxxxxxxx> wrote:
> 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).

One way to fix this is to make your terminal emulator execute the
shells as login shells (gnome-terminal can do that IIRC).

Another way would be to *only* source /etc/profile in your zshrc as
this file gets executed for any interactive shell, login or not.

HTH
Jan



Messages sorted by: Reverse Date, Date, Thread, Author