Bug 65509
Summary: | Zshenv should not source /etc/profile | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Zvi Har'El <rl> |
Component: | zsh | Assignee: | Jens Petersen <petersen> |
Status: | CLOSED RAWHIDE | QA Contact: | Aaron Brown <abrown> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | s.traylen |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-02-10 13:48:16 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 62788 | ||
Bug Blocks: |
Description
Zvi Har'El
2002-05-26 08:53:34 UTC
It was done for consistency with bash - see bug #62788 The fix that was suggested and implemented in bug #62788 seems wrong. The file that should've been changed so zsh mimics bash is /etc/zshrc (which is like the /etc/bashrc file), not /etc/zshenv. Now /etc/profile is being sourced by all zsh shell scripts! You can verify this by comparing the output of the shell script #!/bin/zsh alias to the script #!/bin/bash alias I think that for consistency with bash 1. /etc/zshenv should be empty 2. /etc/zprofile should source /etc/profile 3. /etc/zshrc should be set up like /etc/bashrc There is a big difference between /etc/zshrc and /etc/bashrc. The former is read by every interactve shell just before ~/.zshrc, if the user wants it or not. On the other hand, bash doesnot read /etc/bashrc at all in the standard configuration. It reads only ~/.bashrc, and this may source /etc/bashrc. Redhat supplied ~/.bashrc is # .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi But this may of course be easily modified by the user. It is possible to supply a system wide intereactive configuration by editing the file config-top.h in bash-2 distribution, which has the lines /* System-wide .bashrc file for interactive shells. */ /* #define SYS_BASHRC "/etc/bash.bashrc" */ But this is not done in redhat's installation. I think this differnce should be considered when deciding about redhat's default system-wide startup files. rl.ac.il wrote: >There is a big difference between /etc/zshrc and /etc/bashrc. The >former is read by every interactve shell just before ~/.zshrc, if the >user wants it or not. On the other hand, bash doesnot read /etc/bashrc >at all in the standard configuration. It reads only ~/.bashrc, and >this may source /etc/bashrc. Redhat supplied ~/.bashrc is > ># .bashrc ># User specific aliases and functions ># Source global definitions > >if [ -f /etc/bashrc ]; then . /etc/bashrc fi > >But this may of course be easily modified by the user. It is possible >to supply a system wide intereactive configuration by editing the file >config-top.h in bash-2 distribution, which has the lines > >/* System-wide .bashrc file for interactive shells. */ >/* #define SYS_BASHRC "/etc/bash.bashrc" */ > >But this is not done in redhat's installation. I think this differnce >should be considered when deciding about redhat's default system-wide >startup files. (Cc'ing bash package owner.) I just note in passing too that sourcing /etc/profile from /etc/zshenv causes zsh's "make test" to fail also. Isn't the right thing to do then to add a "/etc/skel/.zshrc" which sources "/etc/profile" like .bashrc? Ugh, just realised that this can only be fixed on existing systems by hand since the config files are %config(noreplace). In zsh-4.0.6-1 the sourcing of /etc/profile is now done in the default .zshrc file, not /etc/zshenv. I hope this improves things. *** Bug 106950 has been marked as a duplicate of this bug. *** |