Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

w is showing the wrong number of logged in users (as in this question), and the answer to that question is that the utmp file is corrupt. This seems likely, as a custom-built hello program is also getting the wrong number, and it works by reading utmp. I've narrowed down the issue to logins from a tty (that is, from someone who is physically at the server logging in using the keyboard attached to it). Essentially, logins from a tty seem to be recorded, but logouts aren't. What's going on?

share|improve this question
Are you asking how to reset utmp? Did you run the command /var/run/utmp mentioned in the answer? –  Kevin Bowen Jan 31 '13 at 13:03
I'm wondering if there's a way to not need to reset utmp, but make it work like it's supposed to on logout. –  cpast Jan 31 '13 at 17:02
@maggotbrain Also, that answer suggested that it is a good idea to do that command in single-user mode, and that's not really an option in my case. –  cpast Jan 31 '13 at 23:05
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.