User logon notification
I just started reading on Linux. I have specific requirement. I want to get the user logon notification to my application on Linux. when any user logs in to the system, my application should get the notification and should get the details about the loged on session.
The restriction is that the application will not poll for any specific file to get this information. Since polling will have the performance hit. Once my application gets notification, it will process that notification.
I tried to check using bash_profile , bash_logout scripts but it has a limitation of working only in textual mode and is limited to bash shell.
Is there any generic way to get the logon notification [compatible for both text and graphical mode, not limited to any shell] ?
**Note:- I am using RedHat Linux
Thanks in Advance
I would suggest that you get the source code to the login command and modify that to alert your application. Then, any login to the system can be monitored however makes sense to you.
You can also add some info in /etc/profile.
I realize that you were looking for a solution that does not poll log-files for this sort of information, but I feel that I should at least mention my application, since it fits your description quite well.
Auhthentication Monitor is free software that runs on Debian and Ubuntu. It monitors the log-files of selected services (such as sshd or proftd, for example) and notifies you when a selected list of users logs in from unknown IP-addresses.
Authentication Monitor can found at my website "bwyan DOT dk" or by searching for "Authentication Monitor" using Google.