how to rc.conf in FreeBSD 8

How can I work out what xxxx_enable="YES" there are ?

E.g.
Code:
mysql_enable="YES"

There must be loads more, but where? What man pages point to this mechanism?

Regards
Ian
 
a129878 said:
Where is there / how can work out what
xxxx_enable="YES" there are ?

EG
mysql_enable="YES"

There must be loads more, but where ??

what man pages point to this mechanism ??

Regards
Ian

For FreeBSD base system ${rc_conf_files} have a look at /etc/defaults/rc.conf and rc.conf(5).

For third party application such as mysql, after port/packages install read the port's message.
 
Oh and if you skipped the after install message use pkg_info(1) with [cmd=]-D[/cmd] flag.

For example:
Code:
% pkg_info -D apache-2.2.14_5                                                                  
Information for apache-2.2.14_5:

Install notice:
To run apache www server from startup, add apache22_enable="YES"
in your /etc/rc.conf. Extra options can be found in startup script.

Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
 
Most (all?) ports that respond to rc.conf variables have scripts in /usr/local/etc/rc.d/.

Don't change anything in /etc/defaults/rc.conf! That's what /etc/rc.conf is for ;)
 
Also don't copy /etc/defaults/rc.conf over to /etc/rc.conf. Simply place in /etc/rc.conf the local settings that differ from the defaults.
 
In FreeBSD Current and the upcoming 7.3-RELEASE you can use the service(1) command to list all available and/or enabled services.
 
Is there any other? ;) It was available early January in any case (I have one built Jan 5).
 
DutchDaemon said:
Is there any other? ;) It was available early January in any case (I have one built Jan 5).

I have one built on 29 dec (haven't had the time to update it) and it doesn't have the command ;)
 
Well, that sets the avant-garde apart from the slackers, SirDice ... wheat and chaff, beauty and the beast ...
 
DutchDaemon said:
Well, that sets the avant-garde apart from the slackers, SirDice ... wheat and chaff, beauty and the beast ...

Yeah, yeah, I know. It's only one machine, my firewall. Haven't updated it yet because there is no real need to do so :e
 
Who needs a need? "Hey, there's an even newer version" is all you need ;)

And now that you know that you're missing service(1), how on earth can you live without it?
 
I've managed without since version 3.x. I think I'll survive LOL
 
Yeah, put on a brave face. But I can see the niggling little doubt at the back of your mind there .. and you'll upgrade. In secret.
 
/me secure shells into his firewall and runs make installworld without telling anyone...
 
At Least Tangram attempted to answered the Question.
And a rucking from a Dutch Deamon, what ever next.

I have compiled my own Apache, so in reality there are two version on my system.

Sure pkg_info -D come up with the details, but that is for the Free give away FreeBSD version
The Question remains, where is there information on what xxxx_anable is.

I grep all under /etc for _enable and there is a ton of stuff in a couple of files.

But nothing on what this xxxx_enable actually is.

I assume its a variable that gets chucked into the startup environment and its the apps that have to look for it.

That gets me no where, as I am sure the main rc.conf mechanism does not fire off every goddam thing under the hood.

Oddly "_enable" returns nothing on this forum search, then, perhaps I can't even manage that properly.

Any one having a go at getting me going on what xxxx_enable is / used / how to use.

Oooops I used the "How to", sorry Mr Deamon.

Ian
 
rc(8) will have all the details.

If the application doesn't come with a FreeBSD RC script under /etc/rc.d/ or /usr/local/etc/rc.d, then you won't be able to use the RC system to control it.

IOW, don't install stuff by hand, use the ports tree. :)
 
Put very simply: when booting, every script in /etc/rc.d and /usr/local/etc/rc.d will be called, but it will refuse to actually execute when the appropriate _enable flag is not set in either /etc/rc.conf or /etc/defaults/rc.conf. In fact, all of those scripts will have the enable flag set to NO, so they need a YES to actually execute.

Random example:
/usr/local/etc/rc.d/mysql-server
Code:
: ${mysql_enable="NO"}

We do want to run mysql at boot time, so what do we have in /etc/rc.conf?
Code:
mysql_enable="YES"

The latter overrules the former, so mysql will be started. That's the basic mechanism of the 'enable' flag.

To find out whether something is enabled, run the start script with the 'rcvar' argument, e.g.

Code:
# /etc/rc.d/named rcvar
# named
#
named_enable="YES"
#   (default: "")

Code:
# /usr/local/etc/rc.d/mysql-server rcvar
# mysql
#
mysql_enable="YES"
#   (default: "")

Code:
# /etc/rc.d/sendmail rcvar
# sendmail
#
sendmail_enable="YES"
#   (default: "")

# sendmail_clientmqueue
#
sendmail_enable="YES"
#   (default: "")
sendmail_msp_queue_enable="YES"
#   (default: "")

Etc.
 
Oh, and for those wanting to use service(1), it's just a shell script, so it can be "backported" to any FreeBSD release that uses RCng. IOW, it should work on any release since 5.2. I've tested it no 6.3 and it works quite nicely.
 
Back
Top