Operating System - HP-UX
1822125 Members
3652 Online
109640 Solutions
New Discussion юеВ

What to do with my $HISTFILE setting under automounter

 
SOLVED
Go to solution
Tony Walker_2
Frequent Advisor

What to do with my $HISTFILE setting under automounter

Hi,

I recently raised a thread (http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=851987) about issues logging in when the users home directory was automounted. I have since discovered as a result of some helpful replies that setting HISTFILE to somewhere other than $HOME such as /tmp/.sh_history solves this and I can log in. However, I would like to keep the shell history functionality and would rather it be kept in their $HOME. I could work out a way round this such as HISTFILE=/tmp/.sh_history$$ but can you suggest anything nicer?

Thanks,

Tony
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: What to do with my $HISTFILE setting under automounter

I remember the thread.

For the HISTFILE to work correctly you need a clean connection to it at login time.

If your connection is stable and there are no connection issues or congestion, you probably can put the HISTFILE anywhere you want.

I think the real answer is to deal with whatever is trobling the NFS. Try and run NFS on a private network, or at least speed up the connection between client and server with Gigabit networking.

Good Luck,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Robert-Jan Goossens
Honored Contributor

Re: What to do with my $HISTFILE setting under automounter

Tony,

Could you post your NFS client and server OS version?

Robert-Jan
Tony Walker_2
Frequent Advisor

Re: What to do with my $HISTFILE setting under automounter

All are running 11i..
Robert-Jan Goossens
Honored Contributor

Re: What to do with my $HISTFILE setting under automounter

I was hoping there would be a nfs or shell patch for this problem. The only thing I could find is below doc. Maybe HP has more/better information or even solutions (patches).

Document description: FAQ: Environment, Shell, and Profile configuration
Document id: KBRC00003700

http://www5.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072883509

NOTE: There is a known problem in which the login process hangs when the sourcing the user's $HOME/.profile file causes the history file to be accessed immediately. This hanging problem usually occurs if the user's $HOME directory is NFS mounted and there is an NFS locking problem on the system. To workaround this problem, set-up the history file in the /tmp directory:

HISTFILE=/tmp/.${USER}.sh_history

Best regards,
Robert-Jan
Pete Randall
Outstanding Contributor

Re: What to do with my $HISTFILE setting under automounter

Tony,

What functionality do you lose? I've been running this way for years without any functionality loss that I'm aware of. I think you need to give it a try.


Pete

Pete
Tony Walker_2
Frequent Advisor

Re: What to do with my $HISTFILE setting under automounter

Pete,

Its not so much a loss of functionality but the way in which its implemented. I'd rather not have dir where everyone can see eachothers shell histories. This can of course be rectified with edits to the .profile and ownership changes and it looks as if this may be the case if this is a known error...
Bill Hassell
Honored Contributor
Solution

Re: What to do with my $HISTFILE setting under automounter

The problem has to do with NFS and file locking. There isn't a workaround (other than keeping a local copy of the shell history) since this is how NFS and the shell work. It's a general NFS issue, not just automounter.


Bill Hassell, sysadmin
Pete Randall
Outstanding Contributor

Re: What to do with my $HISTFILE setting under automounter

Tony,

If it's privacy that concerns you, why don't you just change the permissions on the file. In /etc/profile for example:

umask 066
HISTFILE=/tmp/.sh_history.$(whoami)
export HISTFILE
umask 002

This will create the history file with rw permissions for just the owner.


Pete

Pete