# Boot Script Loop



## zspider (Mar 28, 2012)

Hi, I'm using FreeBSD 9.0 Release. 

I seem to be having a weird problem. Say I have a script that is

```
echo "stop zapping yourself!"
```
 and I specify it in the rc.conf, it should only run during the boot process once right? In my situation the script wont stop and keeps running over and over again until the login screen comes up. 

Then again, maybe it is just not designed to be used in this fashion.

Any clarification would be great.


----------



## SirDice (Mar 28, 2012)

Do NOT put scripts in /etc/rc.conf. It's designed to ONLY have variables. It gets sourced multiple times during the boot phase.

If you need some custom script to run during boot put it in /etc/rc.local.


----------



## zspider (Mar 28, 2012)

Ok thank you SirDice, that worked and I am happy. Just to clarify for anyone else who reads this:/etc/rc.local does not exist by default and has to be created as a file, then you put the path to the script in the file and make the script executable.


----------



## Zare (Mar 30, 2012)

Just make sure you daemonize longer running processes invoked from /etc/rc.local. Init will wait for rc.local script to finish, so several rc.d based initscripts will wait, together with tty(0).


----------

