Operating System - HP-UX
1825805 Members
3550 Online
109687 Solutions
New Discussion

utmp not working - even after reboot

 
Nishan Sandhar
Occasional Advisor

utmp not working - even after reboot

Last week, I found that the /etc/utmp file was corrupted. Tried the repair using the various scripts/procedures mentioned here in the forum, but it didn't work.

The machine was then rebooted this weekend, but the problem remains.

When trying to change the password command, it fails with:

$ passwd
Usage: passwd [ -F file ] [ name ]
$

In addition, the perl "getlogin" function (which utilizes the getlogin() in C/Unix) also fails.

The commonality is the /etc/utmp file.

Any ideas on what else to try?
9 REPLIES 9
harry d brown jr
Honored Contributor

Re: utmp not working - even after reboot

What steps did you take to "repair" the file?

Are the permissions as such:
# ls -l /etc/utmp
-rw-r--r-- 1 root root 1200 Mar 4 09:21 /etc/utmp
#


Have you simply deleted the utmp file???

live free or die
harry
Live Free or Die
S.K. Chan
Honored Contributor

Re: utmp not working - even after reboot

Have you got the latest telnetd patch ? Reason for me to ask this is that if you're running 11.0 for example, there is a patch (PHNE_24762 - telnetd) that is needed to resolve problem of telnetd writting incorrect record to utmp thus corrupting it.
harry d brown jr
Honored Contributor

Re: utmp not working - even after reboot

As S.K. say's, make sure you are up to date on patches, and then get everyone to logoff the server, then remove the /etc/utmp file, and then let them login.

Question, is this a "trusted" system?

live free or die
harry
Live Free or Die
Nishan Sandhar
Occasional Advisor

Re: utmp not working - even after reboot

#ls -ald utmp*
-rw-r--r-- 1 root root 4920 Mar 4 09:09 utmp
-rw-r--r-- 1 root root 24920 Mar 4 09:09 utmpx
#

The permissions are as shown above.

When you telnet to the server, it works fine. The scenario it fails in is when REXEC is used to execute hpterm and display it to another server.

Nishan Sandhar
Occasional Advisor

Re: utmp not working - even after reboot

This is NOT a trusted system.

The password command works fine when logged in via telnet. But when logged in via rexec/x-windows, it fails.

Not sure that a telnet patch is going to help me here.

harry d brown jr
Honored Contributor

Re: utmp not working - even after reboot

Nishan,

I just removed my /etc/utmp file and successfully started an xsession using exceed from you client to my server via rexec.

live free or die
harry
Live Free or Die
Nishan Sandhar
Occasional Advisor

Re: utmp not working - even after reboot

There is no problem STARTING any xwindows applications. Its just that once they're started, "who -m" doesn't show ANYTHING, and things that use the "getlogin ()" function don't work.

-nishan
harry d brown jr
Honored Contributor

Re: utmp not working - even after reboot

Nishan,

If and when you can reboot your server, then remove the /etc/utmp file before the reboot, and everything will be fine after your system is back up.

live free or die
harry
Live Free or Die
Nishan Sandhar
Occasional Advisor

Re: utmp not working - even after reboot

Turned out that OWNER ship of the hpterm and xterm executables changed to "bin" somehow. Once changed back to "root", everything works. Now I'll have to track down why/when they changed.