- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Force logout after a period of inactivity
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 03:16 AM
10-19-2005 03:16 AM
Force logout after a period of inactivity
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 03:20 AM
10-19-2005 03:20 AM
Re: Force logout after a period of inactivity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 03:22 AM
10-19-2005 03:22 AM
Re: Force logout after a period of inactivity
Best regards,
Oz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 05:46 AM
10-19-2005 05:46 AM
Re: Force logout after a period of inactivity
export TMOUT=3600
In csh, the autologout value is in minutes.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 05:52 AM
10-19-2005 05:52 AM
Re: Force logout after a period of inactivity
Set the TMOUT value for the system. You can either add it in /etc/profile OR $HOME/.profile. If you add this in /etc/profile the time out value will be same for all users where as in $HOME/.profile , you can set different values for different users. The line to be added is,
export TMOUT=300
This will allow a 300 sec ( 5 mins) in activity and then the session will be disconnected.
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 05:59 AM
10-19-2005 05:59 AM
Re: Force logout after a period of inactivity
As methioned above, if the user leaves a vi open (or something like that), they aren't doing anything, but the TMOUT variable won't disconnect the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 06:09 AM
10-19-2005 06:09 AM
Re: Force logout after a period of inactivity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 06:19 AM
10-19-2005 06:19 AM
Re: Force logout after a period of inactivity
We have set the TMOUT value in the /etc/profile and after the value the session will be termianted with a message.
If you think the comments/help provided by others have helped you assign points and close this thread.
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 06:40 AM
10-19-2005 06:40 AM
Re: Force logout after a period of inactivity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 07:18 AM
10-19-2005 07:18 AM
Re: Force logout after a period of inactivity
I entered the following in my .cshrc
setenv TMOUT 120
After logging in, verified that the variable is set.
However, I did not see any message to the effect that my session was timed out or any thing like that in the session window even after a few minutes.
Thought some one can explian what I am doing wrong.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 07:52 AM
10-19-2005 07:52 AM
Re: Force logout after a period of inactivity
From Bill's posting above:
"The value to set is TMOUT for POSIX shell, ksh (and other POSIX compliant shells like bash), or autologout for csh."
You need to apply "autologout" for csh.
Hope this helps...
Dwyane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 08:01 AM
10-19-2005 08:01 AM
Re: Force logout after a period of inactivity
setenv autologout 2
and now csh will exit after two minutes of idle time.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 02:56 AM
10-20-2005 02:56 AM
Re: Force logout after a period of inactivity
Added the variable with 'setenv autologout 2' to my .cshrc ( assuming 2 minutes ).
After I log in and do 'echo $autologout' it shows 600. Even after I change my value to 60 from 2, it still shows 600.
Is there some other place where this 600 is preset that overrides what ever is entered in my starting .cshrc file?
I am still unable to force the session after a brief period of inactivity.
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 04:15 AM
10-20-2005 04:15 AM
Re: Force logout after a period of inactivity
To fix the problem, use this command after you login:
echo "*loginShell: true" >> $HOME/.Xdefaults
then start a new terminal window. You'll now see all the profile messages (like the copyright) as well as the "starting .cshrc" message. And your autologout variable will now be set and effective.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 04:51 AM
10-20-2005 04:51 AM
Re: Force logout after a period of inactivity
I did that and now I see the copyright stuff in the new text window ( opened by Exceed ).
However, I get 600 for $autologout even though I put 'setenv autologout 2' in my .cshrc.
Please advise.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 05:46 AM
10-20-2005 05:46 AM
Re: Force logout after a period of inactivity
ls -la $HOME/.cshrc $HOME/.login
.cshrc should have read and execute permissions and owned by your login ID. .login is run after .cshrc, but it sounds like they are not getting run. Verify that by first putting an echo in each file, then login again. To see what happens when your shell actually runs .cshrc, use the source command:
source .cshrc
then display the autologout variable (which will likely be set). csh is quite non-standard as a shell in Unix (except for some programmers), so if you're not tied to a specific shell, you might switch to a more mainstream shell like /usr/bin/sh (HP's POSIX shell) or /usr/bin/ksh. You can change shells at any time with the chsh command:
chsh your_loginID /usr/bin/sh
For sh (which is not Bourne) and ksh, profiles are: /etc/profile and then .profile.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 06:14 AM
10-20-2005 06:14 AM
Re: Force logout after a period of inactivity
I am forced to use the c shell and the .cshrc was given to us by the developer. There is no .login in $HOME.
The echo statements in the .cshrc show up fine after logging in. However, the variable always comes out as 600 regardless of what I put in the .cshrc files for my login.
I am totally at a loss.
Please advise.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 07:07 AM
10-20-2005 07:07 AM
Re: Force logout after a period of inactivity
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 07:29 AM
10-20-2005 07:29 AM
Re: Force logout after a period of inactivity
That rules out the possibility of an exit before the autologout setting is done.
There is no /etc/csh.login file at all in the system. The developer worked only on the .cshrc file.
What I am puzzled about is where the value 600 for the variable autologout coming from even though it is explicitly set in the .cshrc file.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2005 08:43 AM
10-20-2005 08:43 AM
Re: Force logout after a period of inactivity
csh -x .cshrc
and this might help. The key is to look for special programs or scripts inside .cshrc that may be setting autologout.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2005 05:38 AM
10-21-2005 05:38 AM
Re: Force logout after a period of inactivity
Thanks for all your replies. You have been a great help.
I resolved my problem ( always seeing a value of 600 for autologout regardless of what I put in my .cshrc file ) by doing the following.
Replaced the 'setenv autologout 2' with 'set autologout=2' and now I don't see the 600 and see 2 as was intended.
I did not know I could use 'set' while in c shell.
I just have another question. After a login ( which now automatically logs me out after 2 minutes if I did not do anything in that text window ) I start an application which opens up another xterm where the application user interface comes up. It is this application that I would like to see closed if no activity is performed in that application.
My setting 2 minutes in the .cshrc seems to have no effect and the application's screen stays on.
Any thoughts on this ?. I'll appreciate if you could offer any suggestions.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2005 05:57 AM
10-21-2005 05:57 AM
Re: Force logout after a period of inactivity
An application, especially Xwindows programs that are not terminals (a graphics design program for instance) are very difficult because moving or clicking the mouse means nothing to HP-UX. That means that a command like who -u will report no activity on the tty (terminal) for that program even though it is quite busy computing or following mouse clicks. A user that starts vi may be very busy using the program or may have gone home--the shell doesn't know about this condition.
Some sysadmins will watch for increasing values in accumulated CPU time for these programs and kill the program if no additional CPU time is used. But this usually makes the users quite upset so most sysadmins ignore these programs. Note that an idle program consumes no resources. It will be swapped out automatically more RAM space is needed. ABout the only reasonto get rid of idle applications is for special licensing limitations.
Bill Hassell, sysadmin