home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / next / sysadmin / 6613 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.2 KB  |  54 lines

  1. Newsgroups: comp.sys.next.sysadmin
  2. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!lemson
  3. From: lemson@ux1.cso.uiuc.edu (David Lemson)
  4. Subject: Re: loginwindow hooks- ARGHHHH!!!!
  5. Message-ID: <By08zy.Bw2@ux1.cso.uiuc.edu>
  6. Organization: University of Illinois at Urbana
  7. References: <1992Nov19.191653.29086@schbbs.mot.com> <1992Nov20.015714.21620@murdoch.acc.Virginia.EDU>
  8. Date: Fri, 20 Nov 1992 08:02:07 GMT
  9. Lines: 43
  10.  
  11. dmm0t@rincewind.mech.Virginia.EDU (David Meyer) writes:
  12.  
  13. >In article <1992Nov19.191653.29086@schbbs.mot.com>  
  14. >sdunbar@mailbox.fwrdc.rtsg.mot.com (Steven T. Dunbar) writes:
  15. >> I'm trying to do some accounting of my log in time.
  16. >> 
  17. >> I wrote a login script like this:
  18. >> #!/bin/csh
  19. >> echo 'Login :' `/bin/date` >> ~/.worklog
  20. >> 
  21. >> and I wrote a logout script like this:
  22. >> #!/bin/csh
  23. >> echo 'Logout :' `/bin/date` >> ~/.worklog
  24. >> 
  25. >> I then did (as root):
  26. >> 
  27. >> dwrite loginwindow LoginHook /usr/local/bin/loginscript
  28. >> dwrite loginwindow LogoutHook /usr/local/bin/logoutscript
  29. >> 
  30. >> I logged out of the console, used 'exit' to reload the 
  31. >> loginwindow, logged in, and it doesn't work.
  32.  
  33. >loginwindow gets run by root, not by the user logging in.  Hence,
  34. >loginscript and logoutscript also run as root, so you probably
  35. >have /.worklog (since ~root == /) with the information you're
  36. >looking for.
  37.  
  38. >I ran into this problem when I wanted to empty the trashcan on logout;
  39. >I couldn't figure out how to communicate the login ID of the person
  40. >exiting to the LogoutHook script.  FYI, I got around that by just
  41. >emptying everybody's trashcan whenever anyone logs out.  It's an ugly
  42. >hack.
  43.  
  44. The $1 argument to LoginHook is the userid (name) of the user who is
  45. logging in.  I do not think that LogoutHook gets this information
  46. passed to it as well (but would be happy to be proven wrong!  It
  47. would make life simpler).  This is under 2.x, I haven't tried Hooks
  48. in 3.0 yet.
  49. -- 
  50. David Lemson                                                (217) 244-1205
  51. University of Illinois NeXT Campus Consultant / CCSO NeXT Lab System Admin
  52. Internet : lemson@uiuc.edu                UUCP :...!uiucuxc!uiucux1!lemson 
  53. NeXTMail accepted                                  BITNET : LEMSON@UIUCVMD
  54.