- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problem with shell hung
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
11-17-2003 09:53 PM
11-17-2003 09:53 PM
One application sometimes fails and the users close their session and open a new one. The application of the closed session then begin to consume the cpu and I have to kill it. What would be the better metod to detect this and kill it automatically?
Best Regards,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 10:02 PM
11-17-2003 10:02 PM
Re: Problem with shell hung
How do you detect it manually? I would guess that you use the ps command, piped to grep to search for some distinguishing characteristic. Just set the same thing up in a script that can be run by cron at regular intervals of your choosing. Be sure to use full path names and set any environment variables you require as cron's environment is minimal.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 10:20 PM
11-17-2003 10:20 PM
Re: Problem with shell hung
if you know the name of the process that consume the cpu, the you can use the attached script
Note: add an entry in the cron
TS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 10:22 PM
11-17-2003 10:22 PM
Re: Problem with shell hung
i forget the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 01:39 AM
11-18-2003 01:39 AM
Re: Problem with shell hung
in the follwing script I assume, that the process, you want to stop has ppid=1 and is no more associated to a terminal. Try it without | ksh and see, if it fits your needs.
Substitute for process the programme you want to stop.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 01:40 AM
11-18-2003 01:40 AM
Re: Problem with shell hung
in the follwing script I assume, that the process, you want to stop has ppid=1 and is no more associated to a terminal. Try it without | ksh and see, if it fits your needs.
Substitute for process the programme you want to stop.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 03:10 AM
11-18-2003 03:10 AM
Re: Problem with shell hung
The problem is that the only way to identify the process is doing a "top" and seeing the %CPU. It´s PPID is not "1". I cannot kill all the processes and I should be able to isolate the process named
Thanks and regar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 03:29 AM
11-18-2003 03:29 AM
Re: Problem with shell hung
yes, it is a dangerous thing to kill processes automatically. What is the process group leader in such a case, a shell?
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 03:31 AM
11-18-2003 03:31 AM
Re: Problem with shell hung
Now if the application getting hung is hpterm, dtterm or xterm, I would stop using Xwindows completely for those users and run a local terminal program such as Reflection for HP or QCterm or similar. Also, make sure your /etc/profile and/or .profile have not disabled traps with something like: trap "" 1 2 3 15 since this tells the program (and child processes) to ignore things like a hang-up or termination.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 03:43 AM
11-18-2003 03:43 AM
Re: Problem with shell hung
- The parent leader process is a shell.
- We have put "trap "" 1 2 3" in .profile of the users to avoid the users go out to operating system.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 04:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 05:55 AM
11-18-2003 05:55 AM
Re: Problem with shell hung
Since your users can't be trusted to handle a shell prompt (ie, not break out of an application with CTRL-C, etc,) you'll have to write a program that acts as their shell, a menu program with just a few choices. And turn traps back on again.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:04 PM
11-18-2003 09:04 PM
Re: Problem with shell hung
I tried only to 'trap "" 2 3', and it seems to work. Users can not go out to s.o. and the sessions no longers become hung. I was trying to read about the meaning of the different trap signals but I did not find so much. Can you tell me a good source to do this?
Thxs and regards,
R.O.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:34 PM
11-18-2003 09:34 PM
Re: Problem with shell hung
you will find a list of the signals in:
/usr/include/sys/signal.h
with a short description.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:42 PM
11-18-2003 09:42 PM
Re: Problem with shell hung
kill -l
(that's a lower case L, not a 1), more details can be found on the manual signal
man 5 signal