- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell timeout
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
09-29-2004 03:34 AM
09-29-2004 03:34 AM
Shell timeout
All the users use ksh in our HPUX 11i system. The .profile of all the users call another script in this form ". /usr/local/bin/abc" which has a "while true" loop so that the users will only get a menu when they login and when they exit the menu they will be logged out of the system. It has to be that way.
My question is how do I setup a shell timeout or idle timeout of say 30mts?
When I comment the script entry in the .profile and set the TMOUT value in the .profile. It works just fine as desired. But with the script entry enabled the TMOUT has no significance. The same happens when I set the TMOUT in /etc/profile.
Thank you,
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 03:39 AM
09-29-2004 03:39 AM
Re: Shell timeout
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 03:42 AM
09-29-2004 03:42 AM
Re: Shell timeout
Also if you want telnet to timeout, you can use inetd.conf
telnetd -n240 like that.
Check your abc script, and you may put the value in abc script itslelf.
or
DO PS1=" <>"
and then do
TMOUT=90
and afterwards
call the script
Hope this helps
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 03:51 AM
09-29-2004 03:51 AM
Re: Shell timeout
Anil's suggestion is the way to go for TMOUT works for shell inactivity which is not your case (stuck in a menu)
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:02 AM
09-29-2004 04:02 AM
Re: Shell timeout
I checked my reply and thought over it. If the abc script uses, while loop and comes tru all the time, even (who -HT) will not work because, the terminal is not idle. It is doing something. You script should take of these things.
I tried simple thing. Opened a vi session and waited. The idle time (who -HT
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:11 AM
09-29-2004 04:11 AM
Re: Shell timeout
Prashant, I should have mentioned this in my first query but anyway, I had tried the option that you suggested PS1="XYZ" and then export TMOUT=30 in the abc script prior to asking this question in this forum. It didn't help. I even tried putting the TMOUT within the "while true" loop but didn't help. The inted parameter you talked about is not what I need.
Anil, I guess you already said what I was about to say for your response.
Any more ideas/thoughts?????
Thank you,
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:17 AM
09-29-2004 04:17 AM
Re: Shell timeout
while true
do
bdf .
done
And watched the tty. Yes, it gives you idle time in who -HT. I am not sure about what idle time this refers to??--may be terminal activity. You can user who -HT in your case.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:25 AM
09-29-2004 04:25 AM
Re: Shell timeout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:29 AM
09-29-2004 04:29 AM
Re: Shell timeout
As said in my previous post since your main shell has called a menu the TMOUT will not apply because its not "idle" anymore so as Anil suggest your only solution is to look through who -HT that shows tty idle and not shell idle...
I have a case here at work:
# who -HT
NAME LINE TIME IDLE PID COMMENTS
vbe - ttyp1 Sep 27 20:30 old 24719
vbe - ttyp2 Sep 27 20:30 . 24734
vbe - ttyp3 Sep 27 20:30 old 24752
oper + ttyr2 Sep 29 12:18 4:52 22237
tollerju + pty/ttys6 Sep 29 10:49 1:34 17083
oper + pty/ttysb Sep 29 08:25 5:50 16220
porteni + pty/ttyt7 Sep 29 08:49 7:37 8103
rolohugo + pty/ttyt8 Sep 27 08:38 old 5065
revazgil + pty/ttyu3 Sep 29 08:46 0:55 5446
tounsifa + pty/ttyu7 Sep 29 08:49 2:09 8385
revazgil + pty/ttyv4 Sep 29 09:11 2:11 24022
# ps -ef |grep toller
vbe 9539 24734 1 18:24:45 ttyp2 0:00 grep toller
tollerju 17083 17082 0 10:49:31 ttys6 0:01 /opt/oracle/product/7.2.3/bin/iap30 -c /opt/oracle
/product/7
tollerju 17425 17083 0 10:49:40 ? 0:14 oraclePXPX (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTO
COL=beq)))
#
# finger tollerju
Login name: tollerju (messages off) In real life: TOLLER Juliana
Bldg: 123
Directory: /users/ocpa/tollerju Shell: /usr/bin/sh
On since Sep 29 10:49:37 on pty/ttys6 from 160.53.84.208
1 hour 37 minutes Idle Time
No Plan.
I know that when these people connect themselves they launch a shell that calls a menu that calls a Forms3 menu...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 04:30 AM
09-29-2004 04:30 AM
Re: Shell timeout
1. Run a regular cron job to identify and kill any terminal sessions that have been inactive for > 30 mins. The 'w' command displays terminal idle time in minutes and seconds.
2. Have a background process monitor the menu process. The menu can't do anything because it's sitting on a 'read' statement waiting for terminal input.
Just prior to the 'read' run a background script which sleeps for 30 minutes then kills its parent.
If the menu is reactivated by the user typing an option, kill the background script.
The first option is probably easier to implement.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 05:01 AM
09-29-2004 05:01 AM
Re: Shell timeout
I have tested by putting infinite loop on /etc/profile and .profile and idleness are logged on who and w commands.
If we start a process ( infinite loop ) on /etc/profile or .profile so that specific shell process can be controlled in another terminal of same user or super user to manage that particular process.
Because we can not start that specific process in background so that user can not do operation on menu's. IT can be done on foreground only.
Get the idleness of shell as,
who -Ru or who -HT
or
w command or w -h
Write a script and do cron it so that it will run for every one minute to check idleness of shell process and kill that shell process with some message to that user usign wall command with tty ( can get with who or w ).
Or run manual mode to check that with shell script.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 05:59 AM
09-29-2004 05:59 AM
Re: Shell timeout
I guess that seems to be the only option.
-Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 06:01 AM
09-29-2004 06:01 AM
Re: Shell timeout
Thank you everyone for your time and inputs.
-Venkat