service foo does not support chkconfig
I have a simple script which I want to add in boot up. I want it to include in startup and I don't want it to add in rc.local.
Below are the sample of the script #!/bin/bash # #chkconfig 2345 # Use to up application ........... --> script I just notice most of the script in /etc/init.d has chkconfig 2345 <no#1> <no#2> Could someone explain to me what is no#1 and no#2? Also is it possible to have the same no#1 and no#2 to some of the scripts in /etc/init.d? Sorry coz I'm still a newbie. TIA, |
The second number is the priority. I'm afraid I don't know what the last entry is is for. Besides reading the service skeleton file ( probably /etc/init.d/skeleton ) and "man chkconfig" you may also want to read the man page for the insserv command. It does more in explaining the contents of the commented headers.
This is a fragment of my /etc/init.d/hplip file: Code:
# For chkconfig the HPLIP priority (ie: 50) must be less the cupsd When I grep'ed for "chkconfig" in the init.d scripts, I noticed that most didn't have the chkconfig <runlevels> <priority> <lastentry> line but they all had the instserv header information. |
First number is priority of starting, the second number is priority of stopping. For each service in rcX.d, where X is 2345, you'll see a corresponding symbolic link in rc6.d. In the above example you will see and entry like S50hplip and a corresponding entry K10hplip. What this does is allow the services to start and stop in a specific order during start up and shutdown.
As another example, networking starts very early having a priority of 10 and stops late during shutdown with a priority of 90. Bill |
All times are GMT -5. The time now is 02:43 PM. |