<?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: checkproc in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958342#M788720</link>
    <description>Points awarded! Short answer - No checkproc. Long answer, a checkproc look alike can be created using scripting.&lt;BR /&gt;Thanks to both for your input.&lt;BR /&gt;Regards,&lt;BR /&gt;Ken&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Feb 2006 13:55:16 GMT</pubDate>
    <dc:creator>Ken_109</dc:creator>
    <dc:date>2006-02-08T13:55:16Z</dc:date>
    <item>
      <title>checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958335#M788713</link>
      <description>Is there a checkproc program available for hpux 11.11? If so where would I find it at?&lt;BR /&gt;Thanks&lt;BR /&gt;Ken</description>
      <pubDate>Wed, 08 Feb 2006 12:59:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958335#M788713</guid>
      <dc:creator>Ken_109</dc:creator>
      <dc:date>2006-02-08T12:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958336#M788714</link>
      <description>&lt;BR /&gt;Essentially the universal method for doing this is to send a kill -0 PID to the PID that you are interested in. You then examine ${?}; if it's zero then that is a valid process otherwise no. The fundamental problem is that there may be many instances of a given program running. Whicjh one do you really want. Checkproc suffers from that as well and HP-UX lacks a /var/run/xxx.pid file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kill -0 ${PIDPROC} # e.g. obtained from ps -e&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [ ${STAT} -eq 0 ]&lt;BR /&gt;  then&lt;BR /&gt;    "Process running"&lt;BR /&gt;  else&lt;BR /&gt;    "No process"&lt;BR /&gt;  fi</description>
      <pubDate>Wed, 08 Feb 2006 13:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958336#M788714</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-08T13:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958337#M788715</link>
      <description>Ken:&lt;BR /&gt;&lt;BR /&gt;If you mean to query whether or not a process (by name) is running or not, I use something like this:&lt;BR /&gt;&lt;BR /&gt;# myproc=inetd&lt;BR /&gt;# [ -z "`UNIX95= ps -C initd -o pid= -o comm=`" ] &amp;amp;&amp;amp; mailx -s "$myproc is not running!" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;'myproc' is the *basename* of the process you want to query.  &lt;BR /&gt;&lt;BR /&gt;If by "check a process" you mean merely to see if it is alive, then, using its pid, do:&lt;BR /&gt;&lt;BR /&gt;#  kill -0 &lt;PID&gt; 2&amp;gt; /dev/null &amp;amp;&amp;amp; echo "is alive" || echo "no process"&lt;BR /&gt;&lt;BR /&gt;Substitute the &lt;PID&gt; you want to interrogate.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 08 Feb 2006 13:12:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958337#M788715</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-08T13:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958338#M788716</link>
      <description>In Linux there is a binary command, called checkproc. It takes an argument of the full pathname and returns 0 if its running,otherwise 1 or greater. &lt;BR /&gt;&lt;BR /&gt;checkproc checks for running processes  that  use  the  specified  executable.&lt;BR /&gt;checkproc does not use the pid to verify a process but the full path of the corresponding program which is used to identify the executable&lt;BR /&gt;&lt;BR /&gt;This is really a nice thing to have when writing a shutdown script. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;ken&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 13:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958338#M788716</guid>
      <dc:creator>Ken_109</dc:creator>
      <dc:date>2006-02-08T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958339#M788717</link>
      <description>I am familiar with that Linux program BUT it does suffer from the ambiguity I mentioned. Even using full pathnames there may be N instances of the program running --- so which one are you interested in? Wise developers will always look for more universal answers to a problem rather than an OS specific command. Not even all Linux versions have that command but every UNIX/Linux box on the planet has ps and grep and that is the wise approach (if a little more scripting is required).&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 13:29:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958339#M788717</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-08T13:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958340#M788718</link>
      <description>thanks for the input. I guess in the case of a shutdown, I don't really care that there is more than 1 process running. I just want to know if at least 1 is running then proceed to shut them all down appropriately. ps &amp;amp; grep will have to do, plus a bit of scripting.. Yuck..</description>
      <pubDate>Wed, 08 Feb 2006 13:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958340#M788718</guid>
      <dc:creator>Ken_109</dc:creator>
      <dc:date>2006-02-08T13:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958341#M788719</link>
      <description>Hi (again) Ken:&lt;BR /&gt;&lt;BR /&gt;As Clay mentions, with a little scripting...&lt;BR /&gt;&lt;BR /&gt;You can easily leverage the first technique I showed by taking your the name of your executable and using 'basename' to reduce it to the code I offered.&lt;BR /&gt;&lt;BR /&gt;# myproc=/usr/sbin/inetd&lt;BR /&gt;# myproc=`basename $myproc}`&lt;BR /&gt;# [ -z "`UNIX95= ps -C $myproc -o pid= -o comm=`" ] &amp;amp;&amp;amp; echo "dead" || echo "running"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Feb 2006 13:41:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958341#M788719</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-08T13:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: checkproc</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958342#M788720</link>
      <description>Points awarded! Short answer - No checkproc. Long answer, a checkproc look alike can be created using scripting.&lt;BR /&gt;Thanks to both for your input.&lt;BR /&gt;Regards,&lt;BR /&gt;Ken&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2006 13:55:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checkproc/m-p/4958342#M788720</guid>
      <dc:creator>Ken_109</dc:creator>
      <dc:date>2006-02-08T13:55:16Z</dc:date>
    </item>
  </channel>
</rss>

