<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ps -C not returning process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040597#M754356</link>
    <description>I too noticed this behavior. It seems if the the command is longer that 14 characters total it doesn't print.</description>
    <pubDate>Tue, 17 Apr 2007 13:13:41 GMT</pubDate>
    <dc:creator>Court Campbell</dc:creator>
    <dc:date>2007-04-17T13:13:41Z</dc:date>
    <item>
      <title>ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040588#M754347</link>
      <description>&lt;!--!*#--&gt;I recently migrated a database to a new server running 11iv1, and one of my nightly scripts stopped working.&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -C ora_pmon_mx1bprd&lt;BR /&gt;  PID TTY          TIME CMD&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;However, from everything else I can see it should be returning a process:&lt;BR /&gt;&lt;BR /&gt;$ ps -ef | grep ora_pmon_mx1bprd&lt;BR /&gt;  oracle  3436     1  0  Apr 15  ?         0:18 ora_pmon_mx1bprd&lt;BR /&gt;$ UNIX95= ps -f -p 3436&lt;BR /&gt;UID        PID  PPID  C    STIME TTY          TIME CMD&lt;BR /&gt;oracle    3436     1  0  Apr 15  ?           00:18 ora_pmon_mx1bprd&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Tue, 17 Apr 2007 07:26:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040588#M754347</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T07:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040589#M754348</link>
      <description>Jonathan,&lt;BR /&gt;have you tried:&lt;BR /&gt;UNIX95=1 ps -C ora_pmon_mx1bprd&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 08:40:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040589#M754348</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-04-17T08:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040590#M754349</link>
      <description>Jonathan,&lt;BR /&gt;have you also tried:&lt;BR /&gt;UNIX95=ps -C ora_pmon_mx1bprd -o pid=&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 08:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040590#M754349</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-04-17T08:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040591#M754350</link>
      <description>Peter, thanks for your replies.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, neither of those commands returned the running process.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 08:58:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040591#M754350</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T08:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040592#M754351</link>
      <description>There is apparently something unique about the ora_pmon_&lt;SID&gt; programs.  I've tried on one of my oracle systems and it's behaving the same way.&lt;/SID&gt;</description>
      <pubDate>Tue, 17 Apr 2007 09:04:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040592#M754351</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-04-17T09:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040593#M754352</link>
      <description>Patrick, that is a bit of a relief. Since this is a new rp4440 we just cut into production, I was pretty concerned that this might indicate some deeper, uglier issues. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Tue, 17 Apr 2007 09:15:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040593#M754352</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040594#M754353</link>
      <description>&lt;!--!*#--&gt;Hm, with our instances this works.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ uname -srv; UNIX95= ps -C ora_pmon_ALMA        &lt;BR /&gt;HP-UX B.11.11 U&lt;BR /&gt;  PID TTY          TIME CMD&lt;BR /&gt; 6809 ?           00:21 ora_pmon_ALMA&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It says that the xpg4 -C option of ps only parses the basename of the command.&lt;BR /&gt;However, this even works if I include args,&lt;BR /&gt;provided space is quoted.&lt;BR /&gt;Since the pmon proc doesn't appear with args let me demonstrate with the listener proc.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -C tnslsnr -o comm,args&lt;BR /&gt;COMMAND         COMMAND&lt;BR /&gt;tnslsnr         /app/oracle/product/9.2.0/bin/tnslsnr l_alma -inherit&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -C tnslsnr\ l_alma -o comm,args&lt;BR /&gt;COMMAND         COMMAND&lt;BR /&gt;tnslsnr         /app/oracle/product/9.2.0/bin/tnslsnr l_alma -inherit&lt;BR /&gt;&lt;BR /&gt;I suppose you require the PID (maybe for dummy signalling?, e.g. kill -0).&lt;BR /&gt;How about slightly modifying your parsing?&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -u oracle -o pid= -o comm|awk '$2~/^ora_pmon/{print$1}'&lt;BR /&gt;6809&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;or use the Proc::ProcessTable CPAN module&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ perl -MProc::ProcessTable -e 'print map $_-&amp;gt;pid."\n", grep $_-&amp;gt;cmndline =~ /^ora_pmon/, @{Proc::ProcessTable-&amp;gt;new-&amp;gt;table}'&lt;BR /&gt;6809&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 09:44:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040594#M754353</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-17T09:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040595#M754354</link>
      <description>Thanks, Ralph. I just rewrote my script to use ps -ef | grep. I actually don't need anything from the ps output, I am just testing to see that the instance is up before running some SQL.&lt;BR /&gt;&lt;BR /&gt;I did find something interesting, though -- if I do:&lt;BR /&gt;$ UNIX95= ps -C oracle&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I'll keep the thread open in case anyone has additional input...</description>
      <pubDate>Tue, 17 Apr 2007 09:58:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040595#M754354</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T09:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040596#M754355</link>
      <description>Seems like it happens only for those processes that have more than twelve characters displayed under the CMD name column. The only way I'm able to see all pmon processes irrespective of how long their names are by using:&lt;BR /&gt;&lt;BR /&gt;UNIX95=1 ps -C oracle -o comm,args | grep -i pmon&lt;BR /&gt;&lt;BR /&gt;are you running into a similar problem?</description>
      <pubDate>Tue, 17 Apr 2007 12:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040596#M754355</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-04-17T12:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040597#M754356</link>
      <description>I too noticed this behavior. It seems if the the command is longer that 14 characters total it doesn't print.</description>
      <pubDate>Tue, 17 Apr 2007 13:13:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040597#M754356</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2007-04-17T13:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040598#M754357</link>
      <description>Bingo! It appears it is related to the string length. I had never run into that before.&lt;BR /&gt;&lt;BR /&gt;Thanks for the info, Sandman and Court!</description>
      <pubDate>Tue, 17 Apr 2007 13:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040598#M754357</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T13:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: ps -C not returning process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040599#M754358</link>
      <description>The command I was searching for was too many characters.&lt;BR /&gt;&lt;BR /&gt;Thanks, everyone, for the help!</description>
      <pubDate>Tue, 17 Apr 2007 13:47:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-c-not-returning-process/m-p/5040599#M754358</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-04-17T13:47:38Z</dc:date>
    </item>
  </channel>
</rss>

