On Tue, 2003-07-22 at 05:56, David Hláčik wrote: > Hi ... i wrote my own script ... and i want it to start at boot ... how? >
Take a look in the /etc/rc.d/init.d directories (as you've seen). The scripts all follow the same basic setup. These are some of the requirements: # chkconfig: 2345 95 05 This line tells (along with the chkconfig utility) tells which runlevels the script will start in. Here, it will start in runlevels 2,3,4 and 5. The 95 tells at what point in the startup it will get executed. The number ranges from 00-99, with higher numbers getting executed later. For example, you'd want something like mounting network shares to start after the network is started. The last 05 tells at what point in the shutdown (or runlevel change) the script should be executed. In this case it's near the beginning of the shutdown. The start(), stop(), restart() and other functions in the script are called when runlevels change or the /sbin/service utility is used directly. For example, during bringup the system will do a "service network start" at some point. The start() function gets called, network starts. The same thing for the others. To configure the script you'd then just do: chkconfig --level 2345 on This creates the necessary symlinks in /etc/rc.d/rc[0-6].d Of course, you could always just drop it into /etc/rc.local which gets executed at boot. It's not as flexible as the above though.
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
