Corrupted /var/run/utmp and others

Posted on 2000-02-14
Last Modified: 2013-12-16
Okay, here is the deal...

I have two boxes running RedHat 6.  They are both having the same problem; the /var/run/utmp file is constantly getting corrupted.  Top won't run, and everytime I log in now, it sets my terminal to "dumb" automatically.  I can manually change it to something like vt100 or linux, but I need to fix the /var/run/utmp problem as I think it is the root of the cause.  
I have tried re-creating the utmp file by doing a touch /var/run/utmp but when I logout and back in the file is corrupted again.  I don't have any problems when I ssh in via SecureCRT (except for top not working).  I'm guessing that ssh doesn't use utmp for the terminal settings.  So I'm kinda stumped why this file keeps on corrupting.  Any ideas?

Question by:biggleswat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 40

Expert Comment

ID: 2525727
If you've got two instances of this and the rest of the world (as far as we know) doesn't have the problem, then it's likely that something is different about your systems. Whatever it is, it appears to be common to both.

First, what leads you to believe that utmp is being corrupted? A quick check of the top sources doesn't turn up any references to utmp. It does need to be able to read stuff out of /proc, but I don't see any place that it reads utmp. As to the terminal type, if you look at the manpage for utmp you'll see that there isn't any field in the utmp structure to hold the terminal type. Accordingly, that's not the cause of the terminal type being set to dumb.

How does top fail? Have you changed the shell binary or done any fiddling with the shell rc files?


Expert Comment

ID: 2526984
are all the login shells the same?
does who wrok correctly?

Accepted Solution

ventolin earned 100 total points
ID: 2528108
the utmp struct from libc5 has changed in libc6. Because of this, binaries
using the old libc5 struct will corrupt /var/run/utmp and/or /var/log/wtmp.


have you checked the permissions of these files?


a problem with:


there has been an update to the initscripts-4.64-1.i386 RPM


Author Comment

ID: 2535225
Thanks.  That helped quite a bit.

-- Nick

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question