Article View: comp.sys.next.sysadmin
Article #1892Re: loginwindow hooks- ARGHHHH!!!!
From: David Lemson
Date: Fri, 20 Nov 1992 08:02
Date: Fri, 20 Nov 1992 08:02
43 lines
2262 bytes
2262 bytes
dmm0t@rincewind.mech.Virginia.EDU (David Meyer) writes: >In article <1992Nov19.191653.29086@schbbs.mot.com> >sdunbar@mailbox.fwrdc.rtsg.mot.com (Steven T. Dunbar) writes: >> I'm trying to do some accounting of my log in time. >> >> I wrote a login script like this: >> #!/bin/csh >> echo 'Login :' `/bin/date` >> ~/.worklog >> >> and I wrote a logout script like this: >> #!/bin/csh >> echo 'Logout :' `/bin/date` >> ~/.worklog >> >> I then did (as root): >> >> dwrite loginwindow LoginHook /usr/local/bin/loginscript >> dwrite loginwindow LogoutHook /usr/local/bin/logoutscript >> >> I logged out of the console, used 'exit' to reload the >> loginwindow, logged in, and it doesn't work. >loginwindow gets run by root, not by the user logging in. Hence, >loginscript and logoutscript also run as root, so you probably >have /.worklog (since ~root == /) with the information you're >looking for. >I ran into this problem when I wanted to empty the trashcan on logout; >I couldn't figure out how to communicate the login ID of the person >exiting to the LogoutHook script. FYI, I got around that by just >emptying everybody's trashcan whenever anyone logs out. It's an ugly >hack. The $1 argument to LoginHook is the userid (name) of the user who is logging in. I do not think that LogoutHook gets this information passed to it as well (but would be happy to be proven wrong! It would make life simpler). This is under 2.x, I haven't tried Hooks in 3.0 yet. -- David Lemson (217) 244-1205 University of Illinois NeXT Campus Consultant / CCSO NeXT Lab System Admin Internet : lemson@uiuc.edu UUCP :...!uiucuxc!uiucux1!lemson NeXTMail accepted BITNET : LEMSON@UIUCVMD
Technical Details
Message-ID:
<By08zy.Bw2@ux1.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!lemsonReferences:
<1992Nov19.191653.29086@schbbs.mot.com> <1992Nov20.015714.21620@murdoch.acc.Virginia.EDU>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.sysadmin Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!lemson From: lemson@ux1.cso.uiuc.edu (David Lemson) Subject: Re: loginwindow hooks- ARGHHHH!!!! Message-ID: <By08zy.Bw2@ux1.cso.uiuc.edu> Organization: University of Illinois at Urbana References: <1992Nov19.191653.29086@schbbs.mot.com> <1992Nov20.015714.21620@murdoch.acc.Virginia.EDU> Date: Fri, 20 Nov 1992 08:02:07 GMT Lines: 43