![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check user id before running script | cpolikowsky | UNIX for Dummies Questions & Answers | 3 | 06-06-2008 09:02 AM |
| Running a check platform script | heartwork | Shell Programming and Scripting | 4 | 02-03-2007 01:49 PM |
| Check if trigger Script is running | mgirinath | Shell Programming and Scripting | 9 | 04-04-2006 10:07 PM |
| Actively watching for running processes | sysera | Shell Programming and Scripting | 2 | 04-06-2004 10:58 PM |
| check that script is not running twice | Link_02 | Shell Programming and Scripting | 2 | 02-20-2002 04:17 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to check whether a script is running actively or hanged(in deadlock)
Hi
I have a doubt regarding process states in HP unix system. Is there a way to check whether a process is hanged or still actively running? I have few scripts which run for a long time. but sometimes these are getting hanged. But i'm never sure whether they are running or waiting in kind of deadlock. these process are present when i check using "ps -ef" command. Is there any way to tail the output of a process that has already started? i've asked this because we can know whether it's hanged or running. Last edited by truth; 11-22-2005 at 04:27 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You can run the script with set -x or with ksh -x options and redirect the stderr to some file. This will echo each statement into that file when it is run. Then you can check that file and know exactly what exactly your script is doing.
|
|
#3
|
|||
|
|||
|
another tool on HPUX is "truss"...
truss -p activePROCid or truss initiatingJOB |
|
#4
|
|||
|
|||
|
Thanks blowtorch. I tried as u have said. It is working when i'm executing from the command prompt. But when the cronjob runs this process, where will it output the text to if we don't specify any outpath ? I've given the option set -x at the beginning of file without any path for o/p file.
|
|
#5
|
||||
|
||||
|
When you run a script with 'set -x' options, it is run in debug mode, where each command is printed in the terminal window before it is executed. When a script runs through cron, there are no terminals involved, so you wouldn't get any output unless you redirect the stderr to some file.
|
||||
| Google The UNIX and Linux Forums |