I need to add commands that starts every time?at system boot. ? which script is the one that starts first and where can I find it?
Claus Guttesen
2009-Jun-07 18:13 UTC
I need to add commands that starts every time at system boot.
> I need to add commands that starts every time?at system boot. > which script is the one that starts first and where can I find it?You can also try to add something like this to root's crontab: @reboot /sbin/mount -a -- regards Claus When lenity and cruelty play for a kingdom, the gentler gamester is the soonest winner. Shakespeare
Clifton Royston
2009-Jun-07 18:30 UTC
I need to add commands that starts every time at system boot.
On Sun, Jun 07, 2009 at 10:29:57AM -0700, AES wrote:> I need to add commands that starts every time?at system boot. > ? > which script is the one that starts first and where can I find it?You should add a script of your own to the directory /usr/local/etc/rc.d, and have it check the first parameter to see under what circumstances it is being invoked. If the first parameter is "start", then the system is being started, or at least you are requesting that your script be run as if it were starting. I strongly recommend against adding anything to the /etc/rc script itself. If you feel you just *can't* do it via a script in /usr/local/etc/rc.d, which is the better way, add a script called /etc/rc.local and that will be run after all the other start-up steps. "man rc" for more information, man "rcorder" if you need to control the order in which your script runs relative to other startup scripts. -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@lava.net President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services
Doug Barton
2009-Jun-09 18:58 UTC
I need to add commands that starts every time at system boot.
AES wrote:> I need to add commands that starts every time at system boot. > > which script is the one that starts first and where can I find it?If you're Ok with running your commands late in the boot process then /etc/rc.local is your best bet. If what you're doing needs to happen in a certain order relative to the rest of the boot system then you'll want to write your own rc.d-style script and put it in /usr/local/etc/rc.d/. There are several articles in the Handbook that will help you in writing your own script. hth, Doug -- This .signature sanitized for your protection