home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / ultrix / 8856 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  2.4 KB

  1. Path: sparky!uunet!wupost!sdd.hp.com!network.ucsd.edu!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!andrewr
  2. From: andrewr@iagu.itd.adelaide.edu.au (Andrew Rutherford)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Re: Anyway to stop X-windows?
  5. Date: 12 Dec 1992 03:09:33 GMT
  6. Organization: The University of Adelaide
  7. Lines: 48
  8. Message-ID: <1gbl5dINN61n@huon.itd.adelaide.edu.au>
  9. References: <gel.723819055@zen.sys.uea.ac.uk>
  10. NNTP-Posting-Host: iagu.itd.adelaide.edu.au
  11. X-Newsreader: TIN [version 1.1 PL6]
  12.  
  13. Gareth Lee (gel@sys.uea.ac.uk) wrote:
  14. [ ... various stuff deleted ... ]
  15.  
  16. + a specific socket is being used for X communication, as opposed to any
  17. + other legitimate purpose.
  18. + If anyone knows of a way then I'd been very keen to hear.
  19.  
  20.     Have a look at iagu.itd.adelaide.edu.au:/pub/src/netproc.c
  21. (via anonymous ftp, of course.) Needs to be setgid kmem, derived
  22. from the ofiles source code (then hacked majorly, supports
  23. environmental variables, seraching for non-root sockets listening,
  24. sockets to off your network, all sorts of fun stuff.) Flags are listed
  25. in the top few lines of source. Is resonably portable, will compile
  26. on Ultrix (wo flags), SunOS (with -lkvm), and probably a few others.
  27.  
  28.     Does not work with OSF/1 as the kernel tables have changed,
  29. but I'm working on getting it going under both OSF/1 and Solaris 2.0
  30.  
  31.     Anyway, You'd do something like this:
  32.  
  33. kill -9 `netproc Ia | grep 6000 | cut -c11-15`
  34.  
  35.     "I" is internet sockets only (provides as much information
  36. as it can on any type of sockets encountered), and the "a" is to
  37. include process information on all lines - by default, it only
  38. prints process information for the first socket owned by each
  39. process.
  40.  
  41.     So it kills off all processes having anything to do with an
  42. Xserver on :0.0. Of course, you'd want to clean up that line before
  43. you put it in cron so that it doesn't kill off PID 6000, if it happens
  44. to be accessing the network for some reason :-)
  45.  
  46.     Few notes - the flags are a mess at the moment (eg, "u", for
  47. process owned by a user, requires no space to be after it, and it
  48. invalidates the earlier "r" flag for root owned processes, but "r"'s
  49. compliment "R" (only non-root processes) is still valid). Any
  50. suggestions for improvement welcome.
  51.  
  52. Hope this helps,
  53.         Andrew.
  54.  
  55. /*
  56.  * Andrew Rutherford                 andrewr@itd.adelaide.edu.au
  57.  * +61 8 228 5669            Real Programmers always confuse Christmas and
  58.  * Room 1060, Adelaide Uni      Halloween because OCT 31 == DEC 25 !
  59.  */
  60.