- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: trap "echo 'logout'" 0 in 11.31
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
Discussions
Discussions
Forums
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
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
тАО05-03-2010 03:32 PM
тАО05-03-2010 03:32 PM
trap "echo 'logout'" 0 in 11.31
My company recently upgraded from 11.00 to 11.31. Previously, "logout" would appear when our users typed "exit" in the telnet window they were using to access our HP-UX system.
We have the line trap "echo 'logout'" 0 in the .profiles on both the 11.00 system and the 11.31 system. The "logout" message appears on the 11.00 system, but not the 11.31 system.
The shell still exits properly, as we get the message from our telnet program, Procomm Plus, that it has disconnected. We just do not get the "logout" message that used to execute when a shell exit signal was trapped.
Does anyone know if this ability was either removed in 11.31, or perhaps the syntax needed has changed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2010 04:02 PM
тАО05-03-2010 04:02 PM
Re: trap "echo 'logout'" 0 in 11.31
The trap command is ok, and it should work as it is working on 11.00 system,
trap is part of the shell. # man sh-posix will have more info.
-What do you see when you just type trap command in the shell.
- what sheel you are using:
$ echo $SHELL
- what happens if you try :
trap "echo 'LOGOUT'" 0
$ Ctrl+d # or type # exit #to check.
Hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2010 04:19 PM
тАО05-03-2010 04:19 PM
Re: trap "echo 'logout'" 0 in 11.31
Your command looks good and should produce the desired output if you are using correct shell,
- you can try the follwing once you logged in to the account:
$ /usr/bin/sh
$ trap "date " 0
$ exit
[ Do you see the date output.. ]
- Also you can try the following:
$ /usr/bin/sh
$ trap "printf 'LOGOUT\n'" 0
$ exit
[ Do you see the LOGOUT output.. ]
Also check out this page:
http://www.docs.hp.com/en/B2355-90046/ch23s07.html
Hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2010 05:01 PM
тАО05-03-2010 05:01 PM
Re: trap "echo 'logout'" 0 in 11.31
The echo 'logout' with trap 0 is something that was added to .profile back in the late 1980's when the network was a 2400 baud modem. trap 0 is typically used to close and remove temp files and other end-of-job tasks, and the item in .profile may have been only an example. For very fast computers with very fast networks and clients, there is certainly the possibility of a race condition. After all, text on a screen is a very slow event compared to the server and client speeds.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2010 01:11 AM
тАО05-04-2010 01:11 AM
Re: trap "echo 'logout'" 0 in 11.31
you may try
in fact it is working at least on my 11.31 systems.
trap "echo logout; sleep 1" 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2010 10:56 AM
тАО05-04-2010 10:56 AM
Re: trap "echo 'logout'" 0 in 11.31
Oh, and just to answer you, Bill, our telet program stays open and usually has a Status line where it will indicate "Connected" or "Not Connected". But this can be disabled, so our users who had it disabled were not able to do if they were logged out or not. We have login limitations, so it is important that our users do not leave "ghost" login sessions, so their being able to see "logout" is very important to us.
Thank you all for your input. Now it's time to go edit .profiles :)