Bug 11140 - csh does not execute /etc/profile.d
Summary: csh does not execute /etc/profile.d
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: setup   
(Show other bugs)
Version: 6.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-05-01 06:54 UTC by Dr. Tilmann Bubeck
Modified: 2014-03-17 02:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-22 18:54:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for problem (639 bytes, patch)
2000-05-01 06:55 UTC, Dr. Tilmann Bubeck
no flags Details | Diff

Description Dr. Tilmann Bubeck 2000-05-01 06:54:49 UTC
Tcsh does not execute the files stored in /etc/profile.d/*.csh as bash
does. Enclosed you find a patch based upon setup-2.1.8-1 of RHAT 6.2.

This patch does:
  * execute /etc/profile.d/*csh
  * filename completion for "cd" and "rmdir" completes only
    directories (not files)

diff -r -u setup-2.1.8/csh.cshrc setup-2.1.8-till/csh.cshrc
--- setup-2.1.8/csh.cshrc       Thu Jan 13 00:18:52 2000
+++ setup-2.1.8-till/csh.cshrc  Mon May  1 08:34:55 2000
@@ -5,7 +5,17 @@
 if ($?prompt) then
   if ($?tcsh) then
     set prompt='[%n@%m %c]$ '
+    complete cd     'n/*/d/'        # complete only dirs on "cd"
+    complete rmdir  'n/*/d/'        # ... and rmdir
     set prompt=\[`id -nu`@`hostname -s`\]\$\
+  if ( $shlvl != "1" ) then             # We're not a login shell
+    foreach i (/etc/profile.d/*.csh)
+      if ( -x $i ) then
+        source $i
+      endif
+    end
+  endif

Comment 1 Dr. Tilmann Bubeck 2000-05-01 06:55:59 UTC
Created attachment 221 [details]
Patch for problem

Comment 2 Bill Nottingham 2000-05-01 16:15:59 UTC
csh.login should already read profile.d for
login shells; are you invoking (t)csh with
tcsh -l?

Comment 3 Dr. Tilmann Bubeck 2000-05-02 06:13:59 UTC
No, I used gdm (or xdm) to login and my user shell ist "tcsh". Therefore the
xterms are no login shell.... I'm not sure, =when= to execute the things
in /etc/profile.d/*.csh in such a case (because there is =no= login shell), but
they =should= be executed at least once.

To ensure, that all X clients have the same environment, the /etc/profile.d/
should be invoked from xdm (ot it's scripts..)?

BUT some things defined in /etc/profile.d/*.csh (e.g. DIRCOLORs) must be read
by =each= shell and should be executed in /etc/csh.cshrc. BUT some others
should only be executed once at login time.... To make this you probably have
to change semantics of /etc/profile.d/. Maybe something like:

   foo-bar.csh         (deprecated: executed by login and "normal" shells)
   foo-bar.csh-login   (executed only by login shells)
   foo-bar.csh-cshrc   (executed by every shell)

Comment 4 Bill Nottingham 2000-05-22 18:54:59 UTC
This is fixed in the latest setup package in rawhide.

Note You need to log in before you can comment on or make changes to this bug.