Flagging a Warning Message with TMOUT
Hi All,
I have just come to know that we can use the environmental variable TMOUT to set an idle time in seconds after which any inactive session is automatically logged out. In order to achieve this, we can do the following: Edit /etc/profile file and write the line: Code:
TMOUT=3600 Well, can we do something more with it? I mean, can we flag a warning message on the user's screen just before logging him/her out? Such as: Your session will be automatically logged out in .. seconds. Any creative ideas? Regards, Dev. |
A search for the tmout flagged threads found one suggesting a script based on the who command or just changing to the ksh as your default, and the ksh gives a 1 minute warning message prior to terminating the shell.
Note, however, that the TMOUT variable is a shell-specific setting, not a session-specific one. If you look at the output of who -uT you'll see something like this: Code:
$ sudo who -uT Bottom line: I think you'll need to write a "widget" to monitor your X-server activity and add it to the X-server init script if you want to be able to automatically terminate an idle X session. Or, here's a thought: Use one of the power management applications, and set the actions you want to happen after specific idle times. |
Okay, I will try that and post here my finding. Thanks a lot!
|
All times are GMT -5. The time now is 08:56 AM. |