# reload /etc/rc.conf



## m_pahlevanzadeh (Jul 12, 2013)

*H*ow can *I* reload /etc/rc.conf without reboot?


----------



## junovitch@ (Jul 12, 2013)

The closest thing I can think of would be to go to single user mode then back.  You can do this by doing `shutdown now` and then `return` from the console.  This doesn't drop all the network connections so it's not quite the same as rebooting would be but it would re-read /etc/rc.conf as it restarts all the services going back into multi user mode.


----------



## fonz (Jul 13, 2013)

m_pahlevanzadeh said:
			
		

> How can I reload /etc/rc.conf without reboot?


Why would you want to do that? If you wish to (re)start services you can either use service(8) or call the scripts in (/usr/local)/etc/rc.d manually. In most other cases there are still commands you can use. There's generally no need to "re-read" /etc/rc.conf. What's more, there's probably no such thing in the first place because that file is only read during startup, when switching between single user mode and multi-user mode and when manually turning services on or off.


----------



## kpa (Jul 13, 2013)

You can't reload or reread the file, there is no single daemon that could reload it entirely. It's just a /bin/sh shell script that gets sourced by other rc(8) scripts when they are executed.


----------



## m_pahlevanzadeh (Jul 13, 2013)

I added some features to this file.[]So *I* need to re_loa_d it.such as with `init q` for Linux users.


----------



## kpa (Jul 13, 2013)

FreeBSD init(8) does not know about /etc/rc.conf and there are no runlevels in FreeBSD. What "features"? Can't you just restart the service/whatever your customized system is so that it re-reads /etc/rc.conf?


----------



## cpm@ (Jul 13, 2013)

I think you should read this article to know the differences of how the init(8)() command works on Linux and FreeBSD.

Also, see the explanation of the FAQ:
http://www.freebsd.org/doc/en/books/faq/admin.html#idp76213040.


----------



## m_pahlevanzadeh (Jul 13, 2013)

It's interseting, because i think bsd itself undestand new line of /etc/rc.conf, Suppose i have a bsd under load, and i added `pf_enable="YES"`,So bsd itself parse it.

otherwise it's very ....!!!!!
It's interesting, because I think FreeBSD itself understands a new line being added to /etc/rc.conf. Suppose I have a FreeBSD system under load, and I add: 
	
	



```
pf_enable="YES"
```
So FreeBSD itself parses it.


----------



## fonz (Jul 13, 2013)

Not quite. As said before, FreeBSD is not "aware" of /etc/rc.conf and doesn't somehow magically or telepathically notice when you change it. To start a firewall you just configured (as appears to be the case judging from your example), use either `# service pf start` or `# /etc/rc.d/pf start`. Re-reading /etc/rc.conf just doesn't make any sense.


----------



## ShelLuser (Jul 13, 2013)

m_pahlevanzadeh said:
			
		

> It's interseting, because i think bsd itself undestand new line of /etc/rc.conf, Suppose i have a bsd under load, and i added `pf_enable="YES"`,So bsd itself parse it.


Well, then we're basically talking about services, and you can control those either by using their rc command scripts directly (for example /etc/rc.d/pf) or using the service(8) command.

There really is no need what so ever to reload rc.conf.

Something you'll notice right away when trying to start a service which you haven't enabled in rc.conf yet; the system will then complain. However, as soon as you enabled the service in rc.conf the system stops complaining.

Finally; also keep in mind that if all you want to do is start a service manually, and not so much get it to be automatically started all the time, then you can also use the onestart or forcestart command.


----------



## eternal_noob (Aug 21, 2021)

ziomario said:


> I would like to have a command to "reload" rc.conf or a method to tell to FreeBSD to disable the vboxnet driver.


It's one post above yours:


ShelLuser said:


> Well, then we're basically talking about services, and you can control those either by using their rc command scripts directly (for example /etc/rc.d/pf) or using the service(8) command.


Does `/etc/rc.d/vboxnet stop` or `service vboxnet stop` work?

Edit: ziomario don't be embarassed and delete your post. We all have moments we do not to see the wood for the trees!


----------



## ziomario (Aug 23, 2021)

I've deleted the post because I've understood that it makes no sense to reload the whole rc.conf,but we can relaunch or kill the services that are called inside it. I wouldn't added anything useful to the post.


----------

