1751972 Members
4982 Online
108784 Solutions
New Discussion юеВ

Re: csh.login problem

 
Jim Mickens
Frequent Advisor

csh.login problem

Installed RH Linux AS 2.1 on a machine to do a feasability test. Users use the Cshell, but I'm getting errors when logging in. I've narrowed the problem down to the following lines in the /etc/csh.login file:
if ( -d /etc/profile.d ) then
set nonomatch
foreach i ( /etc/profile.d/*.csh )
if ( -r $i ) then
source $i
endif
end
unset i nonomatch
endif

The errors I get are:
root: Command not found.
root: Undefined variable.

I can comment out the first if/endif and it still does the same thing. This script is the default that was installed with the OS. If anyone could knows or has any ideas as to what the problem might be, I'd appreciate it.
5 REPLIES 5
Martin P.J. Zinser
Honored Contributor

Re: csh.login problem

Try to put a set echo in the script to see where you get the problem. Obviously you do not want to do this while you have many other users connecting as they might be annoyed by the wordy output
Jim Mickens
Frequent Advisor

Re: csh.login problem

Good idea. Another thought occurred to me - it might also be another one of the .csh scripts in the /etc/profile.d directory. I put an echo in front of the source command so it just echoed the source instead of actually executing it, and this portion of the script ran without error. Then I ran each source command of the .csh scripts and got the errors when I ran /etc/profile.d/java_jre.csh. Now I just have to figure out what's wrong with that script.
Martin P.J. Zinser
Honored Contributor

Re: csh.login problem

Well, the obvious thing is to check where the JDK/JRE is installed on your system. Root usually has a much more restricted PATH than other users (e.g. no . or /usr/local/bin)
Jim Mickens
Frequent Advisor

Re: csh.login problem

test - sending replies to the messages is blowing up on me.....
Jim Mickens
Frequent Advisor

Re: csh.login problem

Third time's the charm?

The java_jre.csh file had a bad command in it. It said "root = " instead of "set root =" when defining a value. I added 'set' to the command and now it works fine.

Just a heads-up for anyone using RH Linux AS 2.1 with c-shell.....