- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Re-enabling ctrl-C trap after returning from m...
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
06-23-2003 08:12 AM
06-23-2003 08:12 AM
Here's my problem. Whenever I su or login using the admin menu and then return to the previous shell session that I was in, Control-C no longer works. I then have to log out of the shell session that I su's or logged in from.
Any ideas?
Example:
1 - Log in as root
2 - su - hpadmin (runs the admin menu under the hpadmin account)
3 - Exit from menu (Control-C no longer works now that I'm back as root)
I do a ping test after returning from the admin menus and I can't interrupt the pings. To get control-c to work again I have to exit root.
jack...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 08:18 AM
06-23-2003 08:18 AM
SolutionWhen you get in your situation, issue a stty -a and note the intr setting. Sometimes, a programmer will set intr to an impossible value e.g. \377 rather than ignoring an intterupt. This is especially true when Ctrl-C or DEL is used for something else. If intr has been reset then you can issue a stty of your own to reset it. The best method would be to do an initial stty to get the value of the interrupt key and then reset to that value after each return from the applications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 08:19 AM
06-23-2003 08:19 AM
Re: Re-enabling ctrl-C trap after returning from menu..
You can disable the trap with 'trap - INT' :
#!usr/bin/sh
trap '' INT
echo "CTRL_C disabled"
read OK
trap - INT
echo "CTRL_C enabled"
read OK
exit 0
Regrards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 08:20 AM
06-23-2003 08:20 AM
Re: Re-enabling ctrl-C trap after returning from menu..
In case you think my theory of setting the interrupt key sounds hokey, note that the interrupt key is defined for the port NOT for the process. Once set, it remains until a subsequent ioctl() or stty command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 09:46 AM
06-23-2003 09:46 AM
Re: Re-enabling ctrl-C trap after returning from menu..
Clay, your right on the money.
Somehow, somewhere the intr setting gets changed to DEL from ^C. Looks like the quit and erase settings get changed also.
Here's diff output from comparing the settings before and after running the menus.
[4987]root@cordayop:/tmp # diff stty.before stty.after
3,5c3,5
< min = 1; time = 0;
< intr = ^C; quit
< eof = ^D; eol = ^@; eol2
---
> min = 4; time = 0;
> intr = DEL; quit = ^\; erase = #; kill = @
> eof = ^D; eol = ^@; eol2
9,11c9,11
< -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
< ixon ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
< isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
---
> -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
> ixon ixany -ixoff -imaxbel -rtsxoff -ctsxon -ienqak
> isig icanon -iexten -xcase echo -echoe echok -echonl -noflsh