[comp.sys.3b1] Fix for trashed /etc/utmp?

ostroff@penelope.Oswego.EDU (Boyd Ostroff) (04/25/91)

Last night my utmp file got all screwed up and I had to re-boot my 3B1.
This has happened to me a couple times before, but not too often.
Basically I got into a state where logouts were not recognized.  Even
though I was the only user, "who" showed five, several on each line!

Shutting the system down was a pain, since it "thought" there were other
active users.  The shutdown command kept giving "alarms".  Finally I had
to manually kill off some processes, type "sync" three times and then
/etc/reboot.

So, I was curious if there are any utilities out there which can re-build
a messed up utmp file without having to re-boot the system.  I'm also
a little curious why it happens in the first place (I'm running 3.51a),
and whether 3.51m fixes the problem.

||||  Boyd Ostroff / Tech Director / SUNY Oswego Dept of Theatre / 315-341-2987
||||  Sys Admin at cboard.UUCP / Serving the Performing Arts / 315-947-6414/8N1
||||  ostroff@oswego.oswego.edu / cboard!ostroff@natasha.oswego.edu

dt@yenta.alb.nm.us (David B. Thomas) (04/26/91)

ostroff@penelope.Oswego.EDU (Boyd Ostroff) writes:

>So, I was curious if there are any utilities out there which can re-build
>a messed up utmp file without having to re-boot the system.  I'm also

Yup ...

$ > /etc/utmp

Okay, it's not elegant, but it works.  Any users currently logged in won't
be listed anymore, of course, and the run level entry won't be there ..
but it's not such a big deal.  The system can run ok.  As long as any users
who were on log off, then back on, utmp is accurate again.  The command
who -r will fail until you reboot or change run levels.  Simply issuing
# init 2
might fix even this, though I'd have to check.

						little david
-- 
Unix is not your mother.