/usr/local/etc/rc.d in FreeBSD

How do I make mysql server start  in startup?

How to make apache server start in startup?

How to make ftp server start in startup?

Simply, just installed via ports or package,  in FreeBSD there is relation between /etc/rc.conf and /usr/local/etc/rc.d/

for example :

monitor# cat /etc/rc.conf

usbd_enable="NO"
sshd_enable="YES"
apache_enable="YES"
mysql_enable="YES"
svscan_enable="YES"
linux_enable="YES"
radiusd_enable="YES"

just write service name followed by value, YES or NO

I’m not sure what to write? any hint?

Just go to rc.d and see the details, for example :

monitor# cd /usr/local/etc/rc.d/
monitor# ls

apache          radiusd         snmptrapd
mysql-server    snmpd           svscan.sh

looking for available options for mysql server :

monitor# cat mysql-server | more

# Add the following line to /etc/rc.conf to enable mysql:
# mysql_enable (bool):  Set to "NO" by default.
#                       Set it to "YES" to enable MySQL.
# mysql_limits (bool):  Set to "NO" by default.
#                       Set it to yes to run `limits -e -U mysql`
#                       just before mysql starts.
# mysql_dbdir (str):    Default to "/var/db/mysql"
#                       Base database directory.
# mysql_args (str):     Custom additional arguments to be passed
#                       to mysqld_safe (default empty).

you can add in /etc/rc.conf another option beside : mysql_enable="YES"

like :

mysql_dbdir ="/home/mysql_data"

monitor# cat radiusd

#
# Add the following lines to /etc/rc.conf to enable radiusd:
#
# radiusd_enable="YES"
#

option for FreeBSD startup is in your hand 🙂

Tags: