# Script at boot?



## PeteS (Jan 4, 2011)

I need to run a few things at boot. I'm moving from debian to FreeBSD and in debian I would just put them in the script /etc/rc.local.

I searched the forum and google and I found the rc.d scripts but that looked overly complex for such a simple task. 

So I wonder if there is a simple script that would be executed at startup where I can put my startup stuff in?

Thanks in advance,
Pete


----------



## SirDice (Jan 4, 2011)

Yes, it's called...... wait for it..... /etc/rc.local.


----------



## vermaden (Jan 4, 2011)

The /etc/rc.d/local script runs the /etc/rc.local file and /etc/rc.shutdown.local file on shutdown, so You can use your habbits the same here on FreeBSD land.

Just remember that both /etc/rc.local and /etc/rc.shutdown.local files need to have _executable bit_ to work.


----------



## PeteS (Jan 4, 2011)

Ha ha, and there I was looking for everything but the obvious 

Thanks guys!


----------



## SirDice (Jan 4, 2011)

That said it's better to use the rc scripts. But it really depends on what you need to do during boot. The rc scripts have all sorts of neat features like dependencies and start/stop functionality built-in.


----------



## PeteS (Jan 4, 2011)

SirDice said:
			
		

> That said it's better to use the rc scripts. But it really depends on what you need to do during boot. The rc scripts have all sorts of neat features like dependencies and start/stop functionality built-in.



Thanks, I'll keep that in mind. For now I don't need any of the nifty features in the rc scripts and /etc/rc.local worked like a charm.


----------



## DutchDaemon (Jan 4, 2011)

/etc/rc.local doesn't need to be executable. Never has been in my case, anywhere.


----------

