- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- trap "echo 'logout'" 0 in 11.31
-
-
Categories
- Topics
- Hybrid IT with Cloud
- Mobile & IoT
- IT for Data & Analytics
- Transformation
- Strategy and Technology
- Products
- Cloud
- Integrated Systems
- Networking
- Servers and Operating Systems
- Services
- Storage
- Company
- Events
- Partner Solutions and Certifications
- Welcome
- Welcome
- Announcements
- Tips and Tricks
- Feedback
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- Converged Data Center Infrastructure
- Digital Transformation
- Grounded in the Cloud
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- Networking
- OEM Solutions
- Servers: The Right Compute
- Telecom IQ
- Transforming IT
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Categories
-
Forums
-
Blogs
-
InformationEnglish
trap "echo 'logout'" 0 in 11.31
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-03-2010 03:32 PM
05-03-2010 03:32 PM
trap "echo 'logout'" 0 in 11.31
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-03-2010 04:02 PM
05-03-2010 04:02 PM
Re: trap "echo 'logout'" 0 in 11.31
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-03-2010 04:19 PM
05-03-2010 04:19 PM
Re: trap "echo 'logout'" 0 in 11.31
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-03-2010 05:01 PM
05-03-2010 05:01 PM
Re: trap "echo 'logout'" 0 in 11.31
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-04-2010 01:11 AM
05-04-2010 01:11 AM
Re: trap "echo 'logout'" 0 in 11.31
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-04-2010 10:56 AM
05-04-2010 10:56 AM
Re: trap "echo 'logout'" 0 in 11.31
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 :)
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2018 Hewlett Packard Enterprise Development LP