home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.hp:12634 comp.unix.questions:13045
- Path: sparky!uunet!ogicse!hp-cv!hp-pcd!hpcvusn!hpcvusd.cv.hp.com!daves
- From: daves@hpcvusd.cv.hp.com (Dave Serisky)
- Newsgroups: comp.sys.hp,comp.unix.questions
- Subject: Re: Resetting the /etc/utmp, wtmp files after crashed logins
- Message-ID: <1992Nov6.173504.22054@hpcvusn.cv.hp.com>
- Date: 6 Nov 92 17:35:04 GMT
- Article-I.D.: hpcvusn.1992Nov6.173504.22054
- References: <1992Nov3.013718.15982@murdoch.acc.Virginia.EDU> <1992Nov5.143413.1956@rz.uni-karlsruhe.de>
- Sender: nobody@hpcvusn.cv.hp.com (Nobody - UID must be 99999)
- Organization: Hewlett-Packard Co., Corvallis, OR, USA
- Lines: 35
- Nntp-Posting-Host: hpcvusd.cv.hp.com
-
- In article <1992Nov5.143413.1956@rz.uni-karlsruhe.de>, chris@rz.uni-karlsruhe.de (Christian Finger) writes:
- |> In article <1992Nov3.013718.15982@murdoch.acc.Virginia.EDU>, prs9k@brain.med.virginia.edu (Phil Scarr) writes:
- |> | After a recent power failure, several PCs which were logged into our
- |> | HP9000 system crashed but their logins still show up with the w command.
- |> | There are no associated processes for these logins, they are just
- |> | phantoms. Is there any way to reset these ptys? I would assume you
- |> | could reset the /etc/utmp and wtmp files to do this, but I don't know
- |> | how. Help!
- |> |
- |> | -Phil
- |>
- |> The following program will do the job for you:
- |>
- |> /*
- |> * this code is in the public domain. do with it as you
- |> * please. - jfh. 12/19/90
- |> */
- |> ...
-
- There are a few potential problems with the posted program. The
- /etc/utmp file contains entries of types other then USER_PROCESS or
- DEAD_PROCESS. The program will probably mess up the utmp entries for
- the various system entries. Also, I think there are a few other fields
- that need to be set or cleared in order to make a "legal" DEAD_PROCESS.
-
- Casual mucking with the /etc/utmp file can cause problems with your
- system. Problems can range from growing /etc/utmp files to duplicate
- /etc/utmp entries for a single tty/pty (which can confuse applications)
- to corruption that can prevent you from logging into your system and
- will require a reboot to fix.
-
- [BTW, take a look at the getutent(3C) man page for some convenient
- functions for working with the /etc/utmp file.]
-
- -- Dave Serisky
-