if I add postfix_enable:="YES" in /etc/rc.conf postfix service starts on boot. However, if I don't it will not start on boot. This is easy to understand, but /usr/local/etc/rc.d/postfix startup script has small parameter expansion
Code:
: ${postfix_enable:="NO"}
How does it works? How this small code tells script whether postfix_enable set to YES or not in /etc/rc.conf file? Why : used before ${postfix_enable:="NO"}? Here is sample script:
Code:
. /etc/rc.subr
name="postfix"
rcvar=${name}_enable
load_rc_config $name
: ${postfix_enable:="NO"}
: ${postfix_pidfile:="/var/spool/postfix/pid/master.pid"}
: ${postfix_procname:="/usr/local/libexec/postfix/master"}
: ${postfix_flags:=""}
start_cmd=${name}_start
stop_cmd=${name}_stop
extra_commands="reload"
pidfile=${postfix_pidfile}
procname=${postfix_procname}
postfix_start() {
/usr/local/sbin/postfix ${postfix_flags} start
}
postfix_stop() {
/usr/local/sbin/postfix ${postfix_flags} stop
}
run_rc_command "$1"