Bug 11140

Summary: csh does not execute /etc/profile.d
Product: [Retired] Red Hat Linux Reporter: Dr. Tilmann Bubeck <tilmann>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-22 18:54:34 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:
Attachments:
Description Flags
Patch for problem none

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
   else
     set prompt=\[`id -nu`@`hostname -s`\]\$\
   endif
+
+  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
 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.