- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Trying to catch a parent process on a fast dyi...
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
03-27-2006 03:41 AM
03-27-2006 03:41 AM
Trying to catch a parent process on a fast dying proces
I need to see the parent process.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 03:49 AM
03-27-2006 03:49 AM
Re: Trying to catch a parent process on a fast dying proces
Use tusc to start the process.
It will collect good diagnostics.
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.8/
The depot:
usage
ouput=/tmp/tusc.txt
# set tusc equal to process id of the process that is parent.
/usr/contrib/bin/tusc -o $output -p $proc &
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 03:54 AM
03-27-2006 03:54 AM
Re: Trying to catch a parent process on a fast dying proces
e.g.
Suppose that the errent process. is /usr/bin/myprog.
mv /usr/bin/myprog /usr/bin/myprog2
Create a wrapper shell, /usr/bin/myprrog
#!/usr/bin/sh
echo "${PPID}" >> /var/tmp/mylog
exec /usr/bin/myprog2 $@
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 05:15 AM
03-27-2006 05:15 AM
Re: Trying to catch a parent process on a fast dying proces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 05:27 AM
03-27-2006 05:27 AM
Re: Trying to catch a parent process on a fast dying proces
Your wrapper child process could even do something like this:
#!/usr/bin/sh
ps -p ${PPID} -f > /var/tmp/mylog
sleep 5
exit 0
and that would identify the parent process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 05:58 AM
03-27-2006 05:58 AM
Re: Trying to catch a parent process on a fast dying proces
Huh? "...I can see the child in ps -ef ...". Well, then you should be able to see the PID (of the parent).
Is the "parent" respawned from '/etc/inittab' ?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 06:00 AM
03-27-2006 06:00 AM
Re: Trying to catch a parent process on a fast dying proces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 06:05 AM
03-27-2006 06:05 AM
Re: Trying to catch a parent process on a fast dying proces
I have worked with ptree on solaris..
On HP You need to pretty much write your own loop..
/bin/ps -ef | awk -v v=$P1 ' ($3 == v) { print $2
} '
Check if this helps..
Thanks and regards
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 06:19 AM
03-27-2006 06:19 AM
Re: Trying to catch a parent process on a fast dying proces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 11:22 AM
03-27-2006 11:22 AM
Re: Trying to catch a parent process on a fast dying proces
How do you know the dying process exists? If it is by name, you can run ps from a script and have it find the exact name of the problem process when it occurs, then extract the PPID and have ps show the PPID -- all very fast when in a script. Here is an example that runs every second looking for a process named on the command line:
#!/usr/bin/sh
export PATH=/usr/bin
set -u
PROC=$1
while :
do
PSLINE=$(UNIX95=1 ps -C $PROC -o pid= -o ppid= -o args=)
if [ "$PSLINE" != "" ]
then
MYPPID=$(echo "$PSLINE" | awk '{print $2}')
echo "$PROC: $PSLINE"
echo " Parent is: $(ps -fp $MYPPID)"
sleep 1
fi
done
This code will handle only a single copy of the program. If multiple copies are found, only the first one is shown. Call this script findproc, make it executable and then run it. You can output the result into a logfile if the condition doesn't occur too often:
./findproc myProblemProg > /var/tmp/findproc.log
The above script makes use of a little used (but powerful) feature called XPG4 behavior. The -C and -o options are invalid unless the variable UNI95 is temporarily defined. -C produces an exact match for the process name (no grep here) and -o allows you to customize the columns that are listed. By adding a blank = to the end of the -o options, the header line is suppressed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2006 01:20 PM
03-27-2006 01:20 PM
Re: Trying to catch a parent process on a fast dying proces
Other possibilities - there may be a way to enable auditing to see what you want.
The main parent may be tossing something into syslog.
Just a ps -ef to a file, if it happens to catch both the short-lived parent and the short-lived child should indeed also have the longer-lived grandparent process, and you could just walk back the list of ppids.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2006 06:07 AM
03-28-2006 06:07 AM
Re: Trying to catch a parent process on a fast dying proces
Thanks to all.