- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ps -C not returning process
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
04-17-2007 12:26 AM
04-17-2007 12:26 AM
After some research, it turns out that the ps -C command isn't working the way I believe it should. I am testing to see if a process named ora_pmon_mx1bprd is running:
$ UNIX95= ps -C ora_pmon_mx1bprd
PID TTY TIME CMD
$
However, from everything else I can see it should be returning a process:
$ ps -ef | grep ora_pmon_mx1bprd
oracle 3436 1 0 Apr 15 ? 0:18 ora_pmon_mx1bprd
$ UNIX95= ps -f -p 3436
UID PID PPID C STIME TTY TIME CMD
oracle 3436 1 0 Apr 15 ? 00:18 ora_pmon_mx1bprd
Quoting ora_pmon_mx1bprd didn't help. Oracle is obviously renaming the command when it executes, but I don't believe that should be tripping up ps, and this works fine on my other servers (all running 11iv1). Anyone else ever seen something like this?
I know I can rewrite the script to use ps and grep to get the results, but ps -C is much cleaner, and I'm concerned that this might be just a symptom of a deeper problem.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 01:40 AM
04-17-2007 01:40 AM
Re: ps -C not returning process
have you tried:
UNIX95=1 ps -C ora_pmon_mx1bprd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 01:42 AM
04-17-2007 01:42 AM
Re: ps -C not returning process
have you also tried:
UNIX95=ps -C ora_pmon_mx1bprd -o pid=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 01:58 AM
04-17-2007 01:58 AM
Re: ps -C not returning process
Unfortunately, neither of those commands returned the running process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 02:04 AM
04-17-2007 02:04 AM
Re: ps -C not returning process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 02:15 AM
04-17-2007 02:15 AM
Re: ps -C not returning process
I'm still confused as to why the ps -C works fine for the oracle processes on my other systems, but it is good to know that it's not just me.
If anyone has a solution (or has identified the cause) I would be interested, otherwise I'll just rewrite my script to use grep and pass it off as an anomaly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 02:44 AM
04-17-2007 02:44 AM
Re: ps -C not returning process
e.g.
$ uname -srv; UNIX95= ps -C ora_pmon_ALMA
HP-UX B.11.11 U
PID TTY TIME CMD
6809 ? 00:21 ora_pmon_ALMA
It says that the xpg4 -C option of ps only parses the basename of the command.
However, this even works if I include args,
provided space is quoted.
Since the pmon proc doesn't appear with args let me demonstrate with the listener proc.
e.g.
$ UNIX95= ps -C tnslsnr -o comm,args
COMMAND COMMAND
tnslsnr /app/oracle/product/9.2.0/bin/tnslsnr l_alma -inherit
$ UNIX95= ps -C tnslsnr\ l_alma -o comm,args
COMMAND COMMAND
tnslsnr /app/oracle/product/9.2.0/bin/tnslsnr l_alma -inherit
I suppose you require the PID (maybe for dummy signalling?, e.g. kill -0).
How about slightly modifying your parsing?
e.g.
$ UNIX95= ps -u oracle -o pid= -o comm|awk '$2~/^ora_pmon/{print$1}'
6809
or use the Proc::ProcessTable CPAN module
e.g.
$ perl -MProc::ProcessTable -e 'print map $_->pid."\n", grep $_->cmndline =~ /^ora_pmon/, @{Proc::ProcessTable->new->table}'
6809
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 02:58 AM
04-17-2007 02:58 AM
Re: ps -C not returning process
I did find something interesting, though -- if I do:
$ UNIX95= ps -C oracle
it successfully returns all processes spawned from the $ORACLE_HOME/bin/oracle executable, even though they have been renamed to pmon, lgwr, or whatever. This suggests that my problem has something to do with the oracle process renaming itself after being forked.
I the same ps (and Oracle) patches on all my servers, so I really don't know why some would work and some wouldn't.
I'll keep the thread open in case anyone has additional input...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 05:47 AM
04-17-2007 05:47 AM
SolutionUNIX95=1 ps -C oracle -o comm,args | grep -i pmon
are you running into a similar problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 06:13 AM
04-17-2007 06:13 AM
Re: ps -C not returning process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 06:46 AM
04-17-2007 06:46 AM
Re: ps -C not returning process
Thanks for the info, Sandman and Court!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 06:47 AM
04-17-2007 06:47 AM
Re: ps -C not returning process
Thanks, everyone, for the help!