# rc.local location not found



## eiger3970 (May 29, 2017)

Hello,
I use Linux mostly and the run command is in path /etc/rc.local. I need to add a run command in FreeBSD 11.0-RELEASE-p10 and only see /etc/

```
rc.banner
rc.conf
rc.d
rc.d.php
rc.firewall
rc.firmware
rc.initial
rc.initial.defaults
rc.initial.embupgfromcdrom
rc.initial.full2emb
rc.initial.fullupgfromcdrom
rc.initial.halt
rc.initial.hostsallow
rc.initial.install
rc.initial.install1
rc.initial.install1gpt
rc.initial.install2
rc.initial.install2gpt
rc.initial.install3
rc.initial.install3gpt
rc.initial.installemb
rc.initial.installfull
rc.initial.password
rc.initial.ping
rc.initial.reboot
rc.initial.setlanip
rc.initial.setports
rc.resume
rc.shutdown
rc.subr
rc.suspend
```
Should I just create a file /etc/rc.local? I need to run a copy command after boot.

I read this but I'm confused between /etc/rc.d/local and /etc/rc.local.


----------



## ShelLuser (May 29, 2017)

eiger3970 said:


> I use Linux mostly and the run command is in path /etc/rc.local.


Note that FreeBSD works completely different than Linux. For starters its best if you don't touch /etc at all and instead limit yourself to /usr/local/etc for now.



eiger3970 said:


> I need to add a run command in FreeBSD 11.0-RELEASE-p10 and only see /etc/


What exactly is a "run command"? Sorry, but that makes very little sense to me.

If you want to run a command during boot (rough guess on my part) then the easiest way is to utilize cron(8) for that. Simply run `crontab -e` as whatever user account should be running this (or optionally you can edit /etc/crontab), then use @reboot instead of the first 5 fields which normally define the time when a command should run. For more information see the crontab(5) manualpage.


----------



## phoenix (May 29, 2017)

/etc/rc.local doesn't exist by default.  If you create one, then anything in that file will be run as part of the boot process.  It's managed/run  automatically by the /etc/rc.d/local file during the boot process.


----------



## ralphbsz (May 30, 2017)

And if the thing you want to run is either a service (that is started and stopped), or relies on other services (like file system or network), then: create a service file for it (look for examples in /etc/rc.d/ or /usr/local/etc/rc.d/), put it in /usr/local/etc/rc.d/, and enable it with a 1-liner in /etc/rc.conf.  Remember, when in Rome, do like the Romans.


----------

