<?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 Starting and Stopping a Program with a Startup/Shutdown Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943349#M114101</link>
    <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;I have a third-party client program, Nagios NRPE client, running as a standalone daemon on an HP-UX 10.20 machine. I am trying to get it to run automatically on bootup and do an automatic shutdown.&lt;BR /&gt;&lt;BR /&gt;The easiest solution has been for me to create a single-line startup script which invokes the client. The full command is &lt;BR /&gt;&lt;BR /&gt;/opt/nrpe/bin/nrpe -c /opt/nrpe/nrpe.cfg --daemon&lt;BR /&gt;&lt;BR /&gt;The client is started via an S script in the /sbin/rc2.d directory. There are two problems with this approach. &lt;BR /&gt;First, when the system does boot up, and lists the services as being started, the client is started but the listing for the client shows a blank space while the other daemons names are mentioned. &lt;BR /&gt;Second, when  shutting down the workstation, there is no way to know if the nrpe daemon is being successfully turned off. &lt;BR /&gt;&lt;BR /&gt;The altenative option is to clone an existing startup script and modify that to suit the nrpe client. I have done that and manually ran the script to test it. Although the script can start the nrpe client, it is unable to stop it. I have included the script in this message. &lt;BR /&gt;&lt;BR /&gt;The question is, what is the correct syntax for stopping the nrpe client via the startup script?&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Apr 2003 18:23:21 GMT</pubDate>
    <dc:creator>Andrew Kaplan</dc:creator>
    <dc:date>2003-04-03T18:23:21Z</dc:date>
    <item>
      <title>Starting and Stopping a Program with a Startup/Shutdown Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943349#M114101</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;I have a third-party client program, Nagios NRPE client, running as a standalone daemon on an HP-UX 10.20 machine. I am trying to get it to run automatically on bootup and do an automatic shutdown.&lt;BR /&gt;&lt;BR /&gt;The easiest solution has been for me to create a single-line startup script which invokes the client. The full command is &lt;BR /&gt;&lt;BR /&gt;/opt/nrpe/bin/nrpe -c /opt/nrpe/nrpe.cfg --daemon&lt;BR /&gt;&lt;BR /&gt;The client is started via an S script in the /sbin/rc2.d directory. There are two problems with this approach. &lt;BR /&gt;First, when the system does boot up, and lists the services as being started, the client is started but the listing for the client shows a blank space while the other daemons names are mentioned. &lt;BR /&gt;Second, when  shutting down the workstation, there is no way to know if the nrpe daemon is being successfully turned off. &lt;BR /&gt;&lt;BR /&gt;The altenative option is to clone an existing startup script and modify that to suit the nrpe client. I have done that and manually ran the script to test it. Although the script can start the nrpe client, it is unable to stop it. I have included the script in this message. &lt;BR /&gt;&lt;BR /&gt;The question is, what is the correct syntax for stopping the nrpe client via the startup script?&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Apr 2003 18:23:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943349#M114101</guid>
      <dc:creator>Andrew Kaplan</dc:creator>
      <dc:date>2003-04-03T18:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Starting and Stopping a Program with a Startup/Shutdown Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943350#M114102</link>
      <description>It would be stopped by a kill, or K, script in /sbin/rc1.d (the next lower level).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 03 Apr 2003 18:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943350#M114102</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-03T18:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Starting and Stopping a Program with a Startup/Shutdown Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943351#M114103</link>
      <description>Eventhough you are able to start the daemon manully that may not be enough to start/stop using rc. Make sure all PATHS and any other needed env vars are set and exported in your scripts - remember .profile is not sourced.&lt;BR /&gt;&lt;BR /&gt;After you have installed your script in /sbin/init.d/ e.g/ /sbin/init.d/nrpe and made it executable then you need to symbolically link it to entries in the rcN.d directories. The script is manually invoked as /sbin/init.d/nrpe start (or stop).&lt;BR /&gt;&lt;BR /&gt;Let's assume that you want to start at run level 3. Generally, you want to stop it at one lower run-level, i.e. 2.&lt;BR /&gt;&lt;BR /&gt;You would link like this:&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/nrpe /sbin/rc3.d/S900nrpe&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/nrpe /sbin/rc.d/K100nrpe.&lt;BR /&gt;&lt;BR /&gt;By convention the "S" numbers plus the "K" numbers = 1000. That tends toi order the sequence correctly. &lt;BR /&gt;</description>
      <pubDate>Thu, 03 Apr 2003 18:41:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943351#M114103</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-04-03T18:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Starting and Stopping a Program with a Startup/Shutdown Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943352#M114104</link>
      <description>Any environment variable can mess things up.  Though counter to logic, some startups require a TERM variable.  Probably not this one.&lt;BR /&gt;&lt;BR /&gt;You can use /sbin/init.d/template as a template for that script.&lt;BR /&gt;&lt;BR /&gt;Just make a copy, don't mess with the original.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 03 Apr 2003 18:50:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/starting-and-stopping-a-program-with-a-startup-shutdown-script/m-p/2943352#M114104</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-04-03T18:50:52Z</dc:date>
    </item>
  </channel>
</rss>

