![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| su ?? Who logged in First ?? | varungupta | UNIX for Advanced & Expert Users | 2 | 01-24-2008 04:10 PM |
| last logged on info | nokia1100 | Shell Programming and Scripting | 1 | 04-07-2007 12:32 PM |
| Need help getting logged in to server | mayewil | SUN Solaris | 1 | 10-26-2006 04:06 PM |
| know who logged and logged out with their timings | vkandati | UNIX for Dummies Questions & Answers | 3 | 03-09-2005 10:04 AM |
| Is user logged on?? | provo | UNIX for Dummies Questions & Answers | 1 | 12-07-2001 05:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
logged in or logged out?
I have wrote a service with c++ which is always run and now I want to get with it the exact time in that the user log in or log out and then run a script. but the problem is that how could i find that the user logged in or logged out with out checking something frequently?
thanks |
|
||||
|
Running the moral equivalent of tail -f on wtmp will block until the file is written to with a new record, so it might fit your needs after all.
See also http://groups.google.com/group/comp....3d5311b1fec584 |
|
||||
|
The read() blocks when no data is available. The sleep(1) happens when no data is available; you can adjust for how long it sleeps before it tries again, obviously. But this is admittedly a workaround. I don't think there is a platform-independent way to trigger on log-in or log-out events. If you have dbus or similar, maybe that has the facility you are looking for.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|