Start Program at Boot Time
October 27, 2008 Posted by KP
Rebooted my server, I found Apache, Postfix and pure-ftpd didn’t start automatically. This is very basic, but I don’t remember that I had to configure this previously. Reading the scripts under /usr/local/etc/rc.d/, the instructions are very clear, added these lines in /etc/rc.conf:
apache_enable=”YES”
pureftpd_enable=”YES”
postfix_enable=”YES”
Just found the FreeBSD Doc explained this very well:
While not all third party software requires the line in rc.conf, almost every day a new port will be modified to accept this configuration.
In /usr/local/etc/rc.d/apache/postfix
# Add the following lines to /etc/rc.conf to enable postfix:
# postfix_enable (bool): Set it to “YES” to enable postfix.
# Default is “NO”.
# postfix_pidfile (path): Set full path to master.pid.
# Default is “/var/spool/postfix/pid/master.pid”.
# postfix_procname (command): Set command that start master. Used to verify if
# postfix is running.
# Default is “/usr/local/libexec/postfix/master”.
# postfix_flags (str): Flags passed to postfix-script on startup.
# Default is “”.
In /usr/local/etc/rc.d/apache
# Define these apache_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/apache
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
apache_enable=${apache_enable-”NO”}
apache_flags=${apache_flags-”"}
apache_pidfile=${apache_pidfile-”/var/run/httpd.pid”}
In /usr/local/etc/rc.d/mysql-server
# 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).
In /usr/local/etc/rc.d/pure-ftpd
# Add the following lines to /etc/rc.conf to enable pure-ftpd:
# pureftpd_enable=”YES”
Related Posts:
- MySQL Start Script
- Commonly Used Configuration Files and Commands
- Disable Apache Log Files
- Log Files
- Sample of BIND Configuration Files
- First Website Is Running
Filed Under: FreeBSD General