Operating System - HP-UX
1825720 Members
3137 Online
109686 Solutions
New Discussion

Problems with telnet and ksh

 
SOLVED
Go to solution

Problems with telnet and ksh

When i log into a machine with a user that has a korn shell ....the machine sources the local profile....sources the users profile....but stops after that point and never returns to the shell prompt. Sometimes a control C will break it....but not always...


If i log into this machine with a c shell...then change into ksh...then source....its ok. But logging into the machine with a ksh doesn't seem to work.

Any hints or ideas??

The /etc/shells files is there and valid. The shells are there as well.


Thanx for the help.
Hey
17 REPLIES 17
Sanjay_6
Honored Contributor
Solution

Re: Problems with telnet and ksh

Hi,

Is the user home directory on NFS mounted directory. If so you can have the user shell history redirected to the tmp directory instead of the NFS mounted home directory.

Hope this helps.

Regds
Sanjay_6
Honored Contributor

Re: Problems with telnet and ksh

Hi,

Try this link,

http://us-support3.external.hp.com/cki/bin/doc.pl/sid=aeec5d2503ddd01e98/screen=ckiDisplayDocument?docId=200000026056389

This is the solution suggested,

//Quote//

Solve the problem of ksh/sh hanging when the home directory is NFS mounted by setting HISTFILE to point to a locally mounted directory such as /tmp/.sh_hist.$LOGNAME.

//EndQuote//

Hope this helps.

Regds
S.K. Chan
Honored Contributor

Re: Problems with telnet and ksh

Can you post content of the user profile ?
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

add the -x to the user's .profile to throw it into the debugger so you can see where it hangs:

#!/bin/ksh -x


HTH
mark
the future will be a lot like now, only later
Helen French
Honored Contributor

Re: Problems with telnet and ksh

Hi,

Check your user profile for any problems. Try renaming it and login. Also check whether the home directory has any big files ( sh_history).

What about loging for 'sh' ? Is this happens to only one user ?

HTH,
Shiju
Life is a promise, fulfill it!

Re: Problems with telnet and ksh

The users profile is below...
#####
/bin/ksh

clear
ls
####

eof


This is just for testing purposes....
Hey
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

it may be hanging on the "clear". Set the "TERM" variable just above it to match their terminal type.

HTH
mark
the future will be a lot like now, only later

Re: Problems with telnet and ksh

Heres one....

Having the same issue with a 10.20 machine...


But this time...it nevers gets to the users profile....it hangs on the system profile after it prints out the /etc/copyright.


any ideas???


Hey
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

the next item after the copyright file is the message of the day. do an ls -l on /etc/motd to make sure it exists and the permissions are -rw-rw-rw-

also run fuser against /etc/motd to make sure no other process has a lock on it.

HTH
mark
the future will be a lot like now, only later

Re: Problems with telnet and ksh

Here is the updated users .profile


#!/bin/ksh
HISTFILE=/tmp/.sh_hist.$LOGNAME
TERM=vt100
clear
ls




On the 10.20 and 11.00 machines...it now logs in perfectly...but when i do a..


$ . .profile


...the machine replys with..

ksh: .profile: not found




The /bin is within the profile and a command below works fine...

$ ksh . .profile




any ideas??
Hey
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

you probably do not have the . (current directory reference) in your path variable. this is a good thing. try it like this:

. ./.profile


mark
the future will be a lot like now, only later

Re: Problems with telnet and ksh

hey Mark...

That seems to work.


What do I need to do so that the user only has to type in

. .profile


to source there profiles after login??


Hey
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

they should not have to explicitly source it if you have their home directory setup in /etc/passwd--or are all the users logging in with a generic ID?

mark
the future will be a lot like now, only later

Re: Problems with telnet and ksh

No.

This specific account is an Oracle accout. I have multiple .profile files created to source the correct variables for differnt versions of Oracle. So..the may log into the machine....but they will need to source in the appropriate .profile for the specific version / OS they want to test with.


Hey
Mark Greene_1
Honored Contributor

Re: Problems with telnet and ksh

ok. your best option is for them to do the pathname reference, . ./.profile

you really do not want to add the "." reference into the PATH variable, as there are too many potential gotcha's involved that will only cause more problems.

HTH
mark
the future will be a lot like now, only later

Re: Problems with telnet and ksh

Thank you all for your help.


The problem / issues have been solved.


thanx again.
Hey
Sanjay_6
Honored Contributor

Re: Problems with telnet and ksh

Hi,

Try this from any directory,

$ . $HOME/.profile

Note the "." before $HOME

This will source the .profile of the user from his home directory.

Hope this helps.

Regds