Re: script execution on the machine when its boots
Brent Clark wrote:
> Hi all
>
> I have a firewall / gateway ruleset that I want excuted when the
> machine needs to reboot.
>
> I placed the script in /etc/network/if-up.d, but I found that on doing
> so, the script did not execute.
>
> Would anyone know how and where I can place my script for execution on
> the machine when its boots up.
>
> Kind Regards
> Brent Clark
>
1. Execute this command to find your default runlevel:
cat /etc/inittab | grep initdefault
You should see a line like this:
id:2:initdefault:
That means 2 is your default runlevel. This may also be 3, or
rarely 4 or 5.
2. Create your rc.local file like this (as root):
touch /etc/init.d/rc.local
chmod 774 /etc/init.d/rc.local
Put the command into the /etc/init.d/rc.local file
echo hello world
3. update-rc.d -f rc.local start 99 2 3 4 5 .
# Note - you must leave the period in with a space before it.
--
Highest Regards,
Rodney Richison
RCR Computing
http://www.rcrnet.net
118 N. Broadway
Cleveland, OK 74020
918-358-1111
Reply to: