<?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: script to check/start process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199359#M463129</link>
    <description>better approach is to find exact pattern first:&lt;BR /&gt;&lt;BR /&gt;instead of ps -ef | grep eoc use:&lt;BR /&gt;ps -ef | grep -w eoc&lt;BR /&gt;</description>
    <pubDate>Thu, 17 Sep 2009 06:14:54 GMT</pubDate>
    <dc:creator>Hakki Aydin Ucar</dc:creator>
    <dc:date>2009-09-17T06:14:54Z</dc:date>
    <item>
      <title>script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199357#M463127</link>
      <description>Hi,&lt;BR /&gt;I need a script to:&lt;BR /&gt;1. check a process "ps -ef | grep ecoc"&lt;BR /&gt;2. if display "/opt/vantage/bin/ecocComputer-p 1 -t 0"&lt;BR /&gt;3. OK, then exit.&lt;BR /&gt;4. else start/execute "/opt/vantage/bin/restart_ecoagt&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;Ahmed</description>
      <pubDate>Thu, 17 Sep 2009 05:50:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199357#M463127</guid>
      <dc:creator>Ahmed_58</dc:creator>
      <dc:date>2009-09-17T05:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199358#M463128</link>
      <description>Hi,&lt;BR /&gt;quick &amp;amp; dirty and not tested but should give you an idea&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;ps -ef | grep eoc &lt;BR /&gt;&lt;BR /&gt;If [ $? = 0 ]; then&lt;BR /&gt;exit 0&lt;BR /&gt;else&lt;BR /&gt;/opt/vantage/bin/restart_ecoagt&lt;BR /&gt;fi</description>
      <pubDate>Thu, 17 Sep 2009 06:01:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199358#M463128</guid>
      <dc:creator>Stephan._1</dc:creator>
      <dc:date>2009-09-17T06:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199359#M463129</link>
      <description>better approach is to find exact pattern first:&lt;BR /&gt;&lt;BR /&gt;instead of ps -ef | grep eoc use:&lt;BR /&gt;ps -ef | grep -w eoc&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 06:14:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199359#M463129</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-09-17T06:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199360#M463130</link>
      <description>Hi,&lt;BR /&gt;It should like this&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;ps -ef | grep eoc &lt;BR /&gt;If [ $? = 0 ]; &lt;BR /&gt;then &lt;BR /&gt;&lt;BR /&gt;/opt/vantage/bin/ecocComputer-p 1 -t 0&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;&lt;BR /&gt;/opt/vantage/bin/restart_ecoagt&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Thu, 17 Sep 2009 06:15:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199360#M463130</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-09-17T06:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199361#M463131</link>
      <description>On second thought, that is better way:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep -w ecoc | grep -v grep</description>
      <pubDate>Thu, 17 Sep 2009 06:16:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199361#M463131</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-09-17T06:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199362#M463132</link>
      <description>Hi,&lt;BR /&gt;it looks the RC is always "0" as it is not excuting the else command to restart the process!&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep ecoc&lt;BR /&gt;#ps -ef | grep -w ecocComputer&lt;BR /&gt;if [ $? = 0 ]; then&lt;BR /&gt;echo ServerVantage is OK running with ecocComputer process...&lt;BR /&gt;else&lt;BR /&gt;/opt/vantage/bin/restart_ecoagt&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 06:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199362#M463132</guid>
      <dc:creator>Ahmed_58</dc:creator>
      <dc:date>2009-09-17T06:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199363#M463133</link>
      <description>Hi Ahmed,&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep whatever&lt;BR /&gt;will in most cases return at least the process line for the grep command, and therefore you get "0".&lt;BR /&gt;&lt;BR /&gt;Instead of &lt;BR /&gt;ps -ef | grep ecoc&lt;BR /&gt;try this line:&lt;BR /&gt;$(UNIX95= ps -C ecoc &amp;gt; /dev/null)&lt;BR /&gt;&lt;BR /&gt;the space after the equal sign is important!&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 07:12:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199363#M463133</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2009-09-17T07:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: script to check/start process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199364#M463134</link>
      <description>thanks to all, special thanks to John,&lt;BR /&gt;script now working.&lt;BR /&gt;points also given.</description>
      <pubDate>Thu, 17 Sep 2009 08:54:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-check-start-process/m-p/5199364#M463134</guid>
      <dc:creator>Ahmed_58</dc:creator>
      <dc:date>2009-09-17T08:54:15Z</dc:date>
    </item>
  </channel>
</rss>

