<?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: getting init to respawn indefinetly in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153371#M158012</link>
    <description>You need a "pool" of them? Do you mean that you need several concurrently running instances of the same application?&lt;BR /&gt;&lt;BR /&gt;I wouldn't run all of them from init directly. Instead, use a script similar to that attached to keep a limited number of daemons running at all times.&lt;BR /&gt;&lt;BR /&gt;I haven't thoroughly tested this, so be careful! You may end up filling up the process table.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 29 Dec 2003 19:15:12 GMT</pubDate>
    <dc:creator>Jordan Bean</dc:creator>
    <dc:date>2003-12-29T19:15:12Z</dc:date>
    <item>
      <title>getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153366#M158007</link>
      <description>I have an application program running as a "daemon". I need a pool of these, it is intended to do a task and exit, and have another start to take its place.  init would be ideal for starting and managing these processes, but it thinks they respawn too quickly, and gives up on restarting them (10/2minutes, according to the man page).&lt;BR /&gt;&lt;BR /&gt;Is there a way to avoid the default behavior of init for my entries in inittab so that they can respawn quicker that 10 times per 2 minutes.  I imagine this would even be a problem for something like getty that respawns from init, if you had a modem program that fast.</description>
      <pubDate>Mon, 29 Dec 2003 12:10:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153366#M158007</guid>
      <dc:creator>James Myers</dc:creator>
      <dc:date>2003-12-29T12:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153367#M158008</link>
      <description>sounds like you need a wrapper program instead of the inittab as your method. have a script restart the application after it completes...&lt;BR /&gt;&lt;BR /&gt;You can use this format for a down and dirty&lt;BR /&gt;&lt;BR /&gt;proc=`ps -aef |grep "proc" |grep -v grep |wc -l`&lt;BR /&gt;while [$proc -ne 1 ]&lt;BR /&gt;do&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Just off the top of my head, but should work.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Dec 2003 12:15:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153367#M158008</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-12-29T12:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153368#M158009</link>
      <description>init only works like tha man page documents: more than 10 times in 2 minutes and the error message is generated followed by a 5 minute pause in respawning that program. This type of process is much more suited to scripting. Start the script as a background process and in the script, just do something like this:&lt;BR /&gt; &lt;BR /&gt;while :&lt;BR /&gt;do&lt;BR /&gt;  /somedir/someprogram some_prameters..&lt;BR /&gt;  sleep 1&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;That will re-run the program forever with a one second pause between each run. Just put this script name into a start/stop script in /sbin/init.d and link it into the /sbin/rc* directories.</description>
      <pubDate>Mon, 29 Dec 2003 12:35:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153368#M158009</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-29T12:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153369#M158010</link>
      <description>The other thing you can do is write "script1" as follows:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;DO some="" stuff=""&gt;&lt;BR /&gt;&lt;RUN script1=""&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;So it will call itself right before it ends.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;&lt;/RUN&gt;&lt;/DO&gt;</description>
      <pubDate>Mon, 29 Dec 2003 15:23:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153369#M158010</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2003-12-29T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153370#M158011</link>
      <description>Or better yet&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;DO some="" stuff=""&gt;&lt;BR /&gt;exec &amp;lt;script1&amp;gt;&lt;BR /&gt;&lt;BR /&gt;The exec will run the "new" command in the current shell with out creating a new process.&lt;BR /&gt;&lt;BR /&gt;-Dave&lt;/DO&gt;</description>
      <pubDate>Mon, 29 Dec 2003 15:34:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153370#M158011</guid>
      <dc:creator>Dave Johnson_1</dc:creator>
      <dc:date>2003-12-29T15:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153371#M158012</link>
      <description>You need a "pool" of them? Do you mean that you need several concurrently running instances of the same application?&lt;BR /&gt;&lt;BR /&gt;I wouldn't run all of them from init directly. Instead, use a script similar to that attached to keep a limited number of daemons running at all times.&lt;BR /&gt;&lt;BR /&gt;I haven't thoroughly tested this, so be careful! You may end up filling up the process table.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Dec 2003 19:15:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153371#M158012</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-12-29T19:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: getting init to respawn indefinetly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153372#M158013</link>
      <description>I haven't tested it, but what you could do to solve your problem is use a script to start the daemon and to make sure the script always runs, put that in the inittab... What way init only has to respawn your script, not the daemon itself. And that script will run the way it should.&lt;BR /&gt;&lt;BR /&gt;Script will look something like this:&lt;BR /&gt;#! /sbin/sh&lt;BR /&gt;PATH=/sbin:/bin # Add anything the daemon needs&lt;BR /&gt;export PATH&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;   &lt;DAEMON&gt;&lt;BR /&gt;   &lt;POSSIBLY test="" exit="" status="" of="" daemon=""&gt;&lt;BR /&gt;   sleep 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Also, make sure the daemon doesn't fork-and-exit like normal daemons do... That might be the cause of your problem too, of course. You can check it by doing at the testing line:&lt;BR /&gt;if [ $(ps -ef | grep &lt;DAEMON&gt; | grep -v grep | wc -l) -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;   echo Daemon exited, but is still running&lt;BR /&gt;   exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Of course, check the script by just running it from command line.&lt;BR /&gt;&lt;/DAEMON&gt;&lt;/POSSIBLY&gt;&lt;/DAEMON&gt;</description>
      <pubDate>Tue, 30 Dec 2003 01:32:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-init-to-respawn-indefinetly/m-p/3153372#M158013</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-30T01:32:12Z</dc:date>
    </item>
  </channel>
</rss>

