The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-22-2005
Registered User
 

Join Date: Nov 2005
Posts: 3
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.
Reply With Quote
Forum Sponsor
  #2  
Old 11-22-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
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.
Reply With Quote
  #3  
Old 11-22-2005
Registered User
 

Join Date: Oct 2005
Posts: 135
another tool on HPUX is "truss"...

truss -p activePROCid
or
truss initiatingJOB
Reply With Quote
  #4  
Old 11-23-2005
Registered User
 

Join Date: Nov 2005
Posts: 3
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.
Reply With Quote
  #5  
Old 11-23-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0