<?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: cmrunserv under Service Guard in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052190#M708159</link>
    <description>Thanks Melvyn!&lt;BR /&gt;&lt;BR /&gt;1/&lt;BR /&gt;What I mean by "both start and then monitor in the monitoring script itself":&lt;BR /&gt;&lt;BR /&gt;My application is started by customer_defined_run_cmds. Then it's monitored by my monitoring service. Ok, now one of its processes goes down. The monitoring script detects it. And exits... As I use a -r or -R, the monitoring script gets restarted by SG. But what restarts the application ?&lt;BR /&gt;&lt;BR /&gt;Thus my question: do I need to restart the application in the monitoring script ? Just before I exit ? The logic would then be:&lt;BR /&gt;&lt;BR /&gt;while 1 do&lt;BR /&gt; if "one process missing" then&lt;BR /&gt;  start application&lt;BR /&gt;  exit 1&lt;BR /&gt; fi&lt;BR /&gt; ...&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Well, maybe I can drop the customer_defined_run_cmds then. And have everything in the monitoring script. Like:&lt;BR /&gt;&lt;BR /&gt;start application&lt;BR /&gt;while 1 do&lt;BR /&gt; if "one process missing" then &lt;BR /&gt; exit 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I don't control exactly how much time I need to bring the application back up though. So multiple starts may step over one another...&lt;BR /&gt;&lt;BR /&gt;2/&lt;BR /&gt;Why that behavior:&lt;BR /&gt;&lt;BR /&gt;Well, because the environment around the application keeps changing, we are not that sure that is going to start up well... We don't want to wait for 3 - for example - attemps before SG states it can't run on that node. &lt;BR /&gt;&lt;BR /&gt;On the other hand, once it's up and running, we have processes that can die on us often. It's usually fine to restart them invidually on the same box without disturbing the whole behavior of the app. Moving the app on an alternate node may cause a longer overall downtime - to other client apps. I'd say we need SG for the machine fail over feature only...&lt;BR /&gt;&lt;BR /&gt;Maybe I'll end up coding something like:&lt;BR /&gt;&lt;BR /&gt;start application&lt;BR /&gt;if one process missing &lt;BR /&gt; exit 1&lt;BR /&gt;&lt;BR /&gt;count=0&lt;BR /&gt;while 1&lt;BR /&gt; if "one process missing" then&lt;BR /&gt;  if count &amp;gt; 2 exit 1&lt;BR /&gt;  else&lt;BR /&gt;   count++&lt;BR /&gt;   start application&lt;BR /&gt;  fi&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Ugly ? Of course I'd drop -r or -R.&lt;BR /&gt;&lt;BR /&gt;Yes, I'll have a closer look at the Oracle SG scripts.&lt;BR /&gt;&lt;BR /&gt;Thanks everyone again.</description>
    <pubDate>Wed, 20 Aug 2003 20:54:49 GMT</pubDate>
    <dc:creator>David Macchion</dc:creator>
    <dc:date>2003-08-20T20:54:49Z</dc:date>
    <item>
      <title>cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052183#M708152</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Inside a package run script, I start up an application thru "cmrunserv -R my_app /my_app_full_path". This application cannot boot up - because of an incorrect SHLIB_PATH for example. The package is stated running as the run script goes thru. And although MC/SG keeps restarting it, the package status stays running. Normal feature ?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 19 Aug 2003 18:29:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052183#M708152</guid>
      <dc:creator>David Macchion</dc:creator>
      <dc:date>2003-08-19T18:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052184#M708153</link>
      <description>Check your "SERVICE_RESTART" in the package control script.  If the setting is "-R" then it will continue to restart over and over.  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Tue, 19 Aug 2003 22:44:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052184#M708153</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-08-19T22:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052185#M708154</link>
      <description>You normally do not start an application  using cmrunserv, as this is used to start services that would monitor the health of your application.&lt;BR /&gt;I would revisit how you activate your application and also ensure it has the correct SHLIB_PATH environment variable passed to it upon start up.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2003 06:00:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052185#M708154</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2003-08-20T06:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052186#M708155</link>
      <description>cmrunserv -R &lt;BR /&gt;means "restart service an infinite number of times *without* halting the package"&lt;BR /&gt;maybe you want to use&lt;BR /&gt;cmrunserv -r 3  to stop that after the third attempt and initiate failover....&lt;BR /&gt;&lt;BR /&gt;interestingly, and in addition to what Melvyn said, the current man pages *no longer* include the sentence "cmrunserv is not intended for use in the shell ..."&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Bernhard&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2003 10:43:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052186#M708155</guid>
      <dc:creator>Bernhard Mueller</dc:creator>
      <dc:date>2003-08-20T10:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052187#M708156</link>
      <description>Complex applications are normally launched by way of the customer_defined_run_cmds function in the package control script - NOT AS A SERVICE.&lt;BR /&gt;&lt;BR /&gt;Generally, SERVICEs are non-terminating scripts or commands which are most often used to monitor the health of an application which is started via the "customer_defined_run_cmds" function in the script.&lt;BR /&gt;&lt;BR /&gt;A package SERVICE is comprised of 3 components:&lt;BR /&gt;SERVICE_NAME&lt;BR /&gt;SERVICE_CMD&lt;BR /&gt;SERVICE_RESTARTS&lt;BR /&gt;cmrunserv uses all 3 customer_defined parameters to implement the service.  ServiceGuard will monitor the PID of the service, restarting or terminating/failing-over the package if the service command terminates.&lt;BR /&gt;&lt;BR /&gt;I have never seen an admin add another cmrunnserv command in a package control script to launch an application.  As previously stated, use the customer_defined_run_cmds to start the application, and use the SERVICE_* parameters to monitor the application health by way of a monitor script.&lt;BR /&gt;&lt;BR /&gt;-StephenD&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2003 11:48:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052187#M708156</guid>
      <dc:creator>Stephen Doud</dc:creator>
      <dc:date>2003-08-20T11:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052188#M708157</link>
      <description>Thanks!&lt;BR /&gt;&lt;BR /&gt;OK: I have to revisit my design again then.&lt;BR /&gt;&lt;BR /&gt;Basically, you're saying that a package has one and only one service and that service only monitors that the actual application processes are up. These processes are to be started in customer_defined_run_cmds.&lt;BR /&gt;&lt;BR /&gt;But suppose I want to use the -r or -R feature. The monitoring script is then restarted by SG if I decide to exit when one process of the application goes down.&lt;BR /&gt;But I guess customer_defined_run_cmds is not rerun. So, don't I have both to start and then monitor in the monitoring script itself ?&lt;BR /&gt;&lt;BR /&gt;More generally, this is the behavior I'm trying to implement:&lt;BR /&gt;- try to start the application. If it doesn't start right away (only one attempt), then fail the package without even trying on the alternate node.&lt;BR /&gt;- once the application is up and running, keep it up on that machine unless the machine goes down.&lt;BR /&gt;&lt;BR /&gt;It's OK if I need to manually reset the RESTART counter sometimes. But I hope I won't have to code that logic in my monitoring script.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Wed, 20 Aug 2003 14:15:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052188#M708157</guid>
      <dc:creator>David Macchion</dc:creator>
      <dc:date>2003-08-20T14:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052189#M708158</link>
      <description>&amp;gt;Basically, you're saying that a package has one and only one service and that service only monitors that the actual application processes are up. These processes are to be started in customer_defined_run_cmds.&amp;gt;&lt;BR /&gt;Almost correct, you can have multiple services to monitor your application's vital processes.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;But suppose I want to use the -r or -R feature.&amp;gt;&lt;BR /&gt;Yes you can.&lt;BR /&gt;&amp;gt;The monitoring script is then restarted by SG if I decide to exit when one process of the application goes down.&amp;gt;&lt;BR /&gt;Correct, if you find a process you are monitoring dies, you can attempt ro restart the p[roces and monitor again.&lt;BR /&gt;&amp;gt;But I guess customer_defined_run_cmds is not rerun.&amp;gt;&lt;BR /&gt;Correct&lt;BR /&gt;&amp;gt; So, don't I have both to start and then monitor in the monitoring script itself ?&amp;gt;&lt;BR /&gt;Not sure what you mean here, but you can call a separate monitor script from in the package control file, or put some logic in the control script for a monitor section, as is done in the newest Oracle Toolkit script, for example.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;More generally, this is the behavior I'm trying to implement:&lt;BR /&gt;- try to start the application. If it doesn't start right away (only one attempt), then fail the package without even trying on the alternate node.&lt;BR /&gt;- once the application is up and running, keep it up on that machine unless the machine goes down.&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Well that is something completely out of the ordinary, as normally you expect to be able to have the package switch if it fails on startup, as this could be due to many reasons. I believe you will have to writ eand play with your own loic to get that to work.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2003 19:03:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052189#M708158</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2003-08-20T19:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: cmrunserv under Service Guard</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052190#M708159</link>
      <description>Thanks Melvyn!&lt;BR /&gt;&lt;BR /&gt;1/&lt;BR /&gt;What I mean by "both start and then monitor in the monitoring script itself":&lt;BR /&gt;&lt;BR /&gt;My application is started by customer_defined_run_cmds. Then it's monitored by my monitoring service. Ok, now one of its processes goes down. The monitoring script detects it. And exits... As I use a -r or -R, the monitoring script gets restarted by SG. But what restarts the application ?&lt;BR /&gt;&lt;BR /&gt;Thus my question: do I need to restart the application in the monitoring script ? Just before I exit ? The logic would then be:&lt;BR /&gt;&lt;BR /&gt;while 1 do&lt;BR /&gt; if "one process missing" then&lt;BR /&gt;  start application&lt;BR /&gt;  exit 1&lt;BR /&gt; fi&lt;BR /&gt; ...&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Well, maybe I can drop the customer_defined_run_cmds then. And have everything in the monitoring script. Like:&lt;BR /&gt;&lt;BR /&gt;start application&lt;BR /&gt;while 1 do&lt;BR /&gt; if "one process missing" then &lt;BR /&gt; exit 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I don't control exactly how much time I need to bring the application back up though. So multiple starts may step over one another...&lt;BR /&gt;&lt;BR /&gt;2/&lt;BR /&gt;Why that behavior:&lt;BR /&gt;&lt;BR /&gt;Well, because the environment around the application keeps changing, we are not that sure that is going to start up well... We don't want to wait for 3 - for example - attemps before SG states it can't run on that node. &lt;BR /&gt;&lt;BR /&gt;On the other hand, once it's up and running, we have processes that can die on us often. It's usually fine to restart them invidually on the same box without disturbing the whole behavior of the app. Moving the app on an alternate node may cause a longer overall downtime - to other client apps. I'd say we need SG for the machine fail over feature only...&lt;BR /&gt;&lt;BR /&gt;Maybe I'll end up coding something like:&lt;BR /&gt;&lt;BR /&gt;start application&lt;BR /&gt;if one process missing &lt;BR /&gt; exit 1&lt;BR /&gt;&lt;BR /&gt;count=0&lt;BR /&gt;while 1&lt;BR /&gt; if "one process missing" then&lt;BR /&gt;  if count &amp;gt; 2 exit 1&lt;BR /&gt;  else&lt;BR /&gt;   count++&lt;BR /&gt;   start application&lt;BR /&gt;  fi&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Ugly ? Of course I'd drop -r or -R.&lt;BR /&gt;&lt;BR /&gt;Yes, I'll have a closer look at the Oracle SG scripts.&lt;BR /&gt;&lt;BR /&gt;Thanks everyone again.</description>
      <pubDate>Wed, 20 Aug 2003 20:54:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cmrunserv-under-service-guard/m-p/3052190#M708159</guid>
      <dc:creator>David Macchion</dc:creator>
      <dc:date>2003-08-20T20:54:49Z</dc:date>
    </item>
  </channel>
</rss>

