home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp / 12634 < prev    next >
Encoding:
Internet Message Format  |  1992-11-07  |  2.2 KB

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