|
Bugzilla – Full Text Bug Listing |
| Summary: | tcsh config numerous problems | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Volker Kuhlmann <bugz57> |
| Component: | Basesystem | Assignee: | Dr. Werner Fink <werner> |
| Status: | RESOLVED WORKSFORME | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | ||
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | i686 | ||
| OS: | SuSE Linux 10.0 | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | some tcsh config fixes | ||
|
Description
Volker Kuhlmann
2005-11-02 05:54:27 UTC
Created attachment 56211 [details]
some tcsh config fixes
I'm maintainer of the bash and the tcsh and I've tested this. My daily shell for interactive work is the tcsh whereas my scripts are mainly written in bash or bourne shell syntax. For the 10.1 I've mainly rewritten the csh.login/csh.cshrc and the tcsh will now source csh.login before csh.cshrc because now the environment are set in csh.login. Btw: PATH _will_ be set in csh.login because this will be exported to every process started from this shell. Beside this: How often users change their shell? And believe me I now about interactive non-login shells, interactive login shells, non-interactive non-login shells ... For a login with slogin/ssh onto an other system the csh.login is executed beside this, if the $tty and $prompt is set and the user is owner of the terminal the terminal setups should be executed. For executio of a single command with ssh on a remote host the PATH is set by the ssh or should be know by the remote command, e.g. by using the full path, to avoid problems with other path layouts on the remote system. The commands rsh/rcp should not be used but slogin/ssh/scp. The noglob is now disabled around the path expansion. I hope you didn't have this really bad idea of recompiling tcsh to load csh.login before csh.cshrc? It's seriously bad because it breaks expected tcsh behaviour. The initial braindead decision about csh.login can't be fixed, you have to forget about csh.login ever existed and put its contents at the top of cshrc, surrounded by suitable if's. Feel free to use a sourced file between if..endif. If the path setting in csh.login is exported (i.e. inherited) by every subshell, how do you explain this behaviour: > ssh -l user remotehost echo '$path' /sbin /usr/sbin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin /usr/lib/mit/bin /usr/lib/mit/sbin /usr/local/bin > ssh -l user remotehost ... remotehost|user[1]:~> echo $path /sbin /usr/sbin /usr/local/sbin /usr/bin /bin /usr/lib/mit/bin /usr/lib/mit/sbin /usr/local/bin /home/user2/bin /usr/games /opt/gnome/bin /opt/kde3/bin /usr/bin/X11 Note the difference in X11, KDE, gnome. Hence my stressing the different types of shells, and the need to set the path in all. How often users change shell is missing the point. The point is that whatever shell $USER chooses, (s)he expects the same environment variables!!! What have you done about the differences in environment variable settings between bash and tcsh? What have you done to ensure that with the next change to bash, the equivalent change happens to tcsh? What have you done about the incorrect .../sbin concatenation in the tcsh path? Btw I know I shouldn't use rcp, but on some boxes (not mine) there's no ssh and anyway it was an illustration about a point of tcsh, not of how to login in remotely. Reopening, too many unaddressed issues. I'll will not switch back with the order of sourcing csh.login and csh.cshrc.
The manual page state that this is also possible. If you want the same
behaviour of bash and tcsh this is the way to go. And I've made /etc/profile
and /etc/csh.login more equal by exchanging features and settings in both
dirtections.
I expect that you know that the ssh does not expand and never has expanded
the path variable but only exported it. Therefore if you are only executing
a remote command you'll get what you've done, see manual page of ssh:
If command is specified, command is executed on the remote host instead
of a login shell.
... maybe I do expand the path in /etc/bash.bashrc and /etc/csh.cshrc if the
variable SSH_CLIENT is found the first time. An old idea of mine just similar
to the method done for setting the locale if the variable SSH_SENDS_LOCALE
is _not_ found.
Thanks Werner! If ssh cmd doesn't run any shell at all then that makes sense, but I don't understand your expansion of path in connection with SSH_CLIENT. If ssh cmd doesn't run a shell you'd never get to /etc/any-rc, and ssh without cmd runs a login shell. Will these changes come out for 10.0? Try out openSuSE 10.1 ;)
The sshd does use a simple system() function call, therefore it runs
the SHELL found in passwd withj the option -c. For this reason I've
added
#
# Just in case the user excutes a command with ssh
#
if test -n "$SSH_CLIENT" -a -z "$PROFILEREAD" ; then
. /etc/profile > /dev/null 2>&1
fi
to /etc/bash.bashrc ... and
#
# Just in case the user excutes a command with ssh
#
if ( ${?SSH_CLIENT} && ! ${?CSHRCREAD} ) then
source /etc/csh.login >& /dev/null
endif
to /etc/csh.cshrc. I'm pretty sure that I'll will
beaten by others for this change ;)
|