All you need to do is add two lines of comments to your /etc/init.d/SCRIPTNAME script that tell chkconfig at which runlevels it should run.

from this manpage:

For example, random.init has these three lines: # chkconfig: 2345 20 80 # description: Saves and restores system entropy pool for \ # higher quality random number generation. This says that the random script should be started in levels 2 +, 3, 4, and 5, that its start priority should be 20, and that its stop + prior- ity should be 80. You should be able to figure out what the d +escrip- tion says; the \ causes the line to be continued. The extra sp +ace in front of the line is ignored.
The runlevel determines at which runlevels the deamon should run. The system is always in one runlevel only. Usual runlevels are 3 for multi-user non-graphical (default mode for server machines), 5 for multi-user graphical mode (default mode for desktop machines) and 1 for single-user non-gui mode (for low-level system management and repair). what each runlevel is for can be changed, these are just usual configurations

To see which run-level is the default for your system, take a look at /etc/inittab. There should be a line about that at the top somewhere. Mine looks like:

# The default runlevel. id:3:initdefault:
So my machine's default runlevel is 3 (though I also use 5)

The start and end priorities determine the order in which deamons are started and stopped: higher start priority means it's started later than lower priority.

After you've done that, run "chkconfig --add NAME_OF_SCRIPT_IN_INITRD" to add it to the list of deamons to start automatically.


In reply to Re^2: How do I start a perl daemon at boot time by Joost
in thread How do I start a perl daemon at boot time by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.