Bug 11140 - csh does not execute /etc/profile.d
csh does not execute /etc/profile.d
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-01 02:54 EDT by Dr. Tilmann Bubeck
Modified: 2014-03-16 22:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-22 14:54:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 02:55 EDT, Dr. Tilmann Bubeck
no flags Details | Diff

  None (edit)
Description Dr. Tilmann Bubeck 2000-05-01 02:54:49 EDT
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 02:55:59 EDT
Created attachment 221 [details]
Patch for problem
Comment 2 Bill Nottingham 2000-05-01 12:15:59 EDT
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 02:13:59 EDT
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 14:54:59 EDT
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.