version 1.265, 2005/05/18 13:44:35 |
version 1.266, 2005/05/18 16:43:51 |
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin |
PATH=/sbin:/bin:/usr/sbin:/usr/bin |
export PATH |
export PATH |
|
|
if [ $1x = shutdownx ]; then |
if [ X"$1" = X"shutdown" ]; then |
dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1 |
dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1 |
chmod 600 /var/db/host.random >/dev/null 2>&1 |
chmod 600 /var/db/host.random >/dev/null 2>&1 |
if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then |
if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then |
|
|
test "$if" = "carp[0-9]*" && continue |
test "$if" = "carp[0-9]*" && continue |
|
|
ifconfig $if > /dev/null 2>&1 |
ifconfig $if > /dev/null 2>&1 |
if [ "$?" != "0" ]; then |
if [ $? -ne 0 ]; then |
ifconfig $if down |
ifconfig $if down |
fi |
fi |
done |
done |
|
|
if [ "X${powerdown}" = X"YES" ]; then |
if [ X"${powerdown}" = X"YES" ]; then |
exit 2 |
exit 2 |
fi |
fi |
|
|
|
|
|
|
if [ -e /fastboot ]; then |
if [ -e /fastboot ]; then |
echo "Fast boot: skipping disk checks." |
echo "Fast boot: skipping disk checks." |
elif [ $1x = autobootx ]; then |
elif [ X"$1" = X"autoboot" ]; then |
echo "Automatic boot in progress: starting file system checks." |
echo "Automatic boot in progress: starting file system checks." |
fsck -p |
fsck -p |
case $? in |
case $? in |
|
|
kbd `cat /etc/kbdtype` |
kbd `cat /etc/kbdtype` |
fi |
fi |
|
|
if [ "X${pf}" != X"NO" ]; then |
if [ X"${pf}" != X"NO" ]; then |
RULES="block all" |
RULES="block all" |
RULES="$RULES\npass on lo0" |
RULES="$RULES\npass on lo0" |
RULES="$RULES\npass in proto tcp from any to any port 22 keep state" |
RULES="$RULES\npass in proto tcp from any to any port 22 keep state" |
|
|
fi |
fi |
. /etc/netstart |
. /etc/netstart |
|
|
if [ "X${pf}" != X"NO" ]; then |
if [ X"${pf}" != X"NO" ]; then |
if [ -f ${pf_rules} ]; then |
if [ -f ${pf_rules} ]; then |
pfctl -f ${pf_rules} |
pfctl -f ${pf_rules} |
fi |
fi |
|
|
|
|
echo 'starting system logger' |
echo 'starting system logger' |
rm -f /dev/log |
rm -f /dev/log |
if [ "X${named_flags}" != X"NO" ]; then |
if [ X"${named_flags}" != X"NO" ]; then |
rm -f /var/named/dev/log |
rm -f /var/named/dev/log |
syslogd_flags="${syslogd_flags} -a /var/named/dev/log" |
syslogd_flags="${syslogd_flags} -a /var/named/dev/log" |
fi |
fi |
|
|
|
|
# $named_flags is imported from /etc/rc.conf; |
# $named_flags is imported from /etc/rc.conf; |
# if $named_flags != NO, named is run. |
# if $named_flags != NO, named is run. |
if [ "X${named_flags}" != X"NO" ]; then |
if [ X"${named_flags}" != X"NO" ]; then |
if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then |
if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then |
echo -n "rndc-confgen: generating new shared secret... " |
echo -n "rndc-confgen: generating new shared secret... " |
if /usr/sbin/rndc-confgen -a -t /var/named >/dev/null 2>&1; then |
if /usr/sbin/rndc-confgen -a -t /var/named >/dev/null 2>&1; then |
|
|
|
|
# $isakmpd_flags is imported from /etc/rc.conf; |
# $isakmpd_flags is imported from /etc/rc.conf; |
# If $isakmpd_flags == NO, isakmpd isn't run. |
# If $isakmpd_flags == NO, isakmpd isn't run. |
if [ "X${isakmpd_flags}" != X"NO" ]; then |
if [ X"${isakmpd_flags}" != X"NO" ]; then |
echo 'starting isakmpd'; isakmpd ${isakmpd_flags} |
echo 'starting isakmpd'; isakmpd ${isakmpd_flags} |
fi |
fi |
|
|
|
|
|
|
# $nfs_server is imported from /etc/rc.conf; |
# $nfs_server is imported from /etc/rc.conf; |
# if $nfs_server == YES, the machine is setup for being an nfs server |
# if $nfs_server == YES, the machine is setup for being an nfs server |
if [ X${nfs_server} = X"YES" -a -s /etc/exports -a \ |
if [ X"${nfs_server}" = X"YES" -a -s /etc/exports -a \ |
`sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ]; then |
`sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ]; then |
rm -f /var/db/mountdtab |
rm -f /var/db/mountdtab |
echo -n > /var/db/mountdtab |
echo -n > /var/db/mountdtab |
echo -n ' mountd'; mountd |
echo -n ' mountd'; mountd |
echo -n ' nfsd'; nfsd ${nfsd_flags} |
echo -n ' nfsd'; nfsd ${nfsd_flags} |
if [ X${lockd} = X"YES" ]; then |
if [ X"${lockd}" = X"YES" ]; then |
echo -n ' rpc.lockd'; rpc.lockd |
echo -n ' rpc.lockd'; rpc.lockd |
fi |
fi |
fi |
fi |
|
|
if [ X${amd} = X"YES" -a -e ${amd_master} ]; then |
if [ X"${amd}" = X"YES" -a -e ${amd_master} ]; then |
echo -n ' amd' |
echo -n ' amd' |
(cd /etc/amd; amd -l syslog -x error,noinfo,nostats -p \ |
(cd /etc/amd; amd -l syslog -x error,noinfo,nostats -p \ |
-a ${amd_dir} `cat ${amd_master}` > /var/run/amd.pid ) |
-a ${amd_dir} `cat ${amd_master}` > /var/run/amd.pid ) |
|
|
|
|
# $timed_flags is imported from /etc/rc.conf; |
# $timed_flags is imported from /etc/rc.conf; |
# if $timed_flags == NO, timed isn't run. |
# if $timed_flags == NO, timed isn't run. |
if [ "X${timed_flags}" != X"NO" ]; then |
if [ X"${timed_flags}" != X"NO" ]; then |
echo -n ' timed'; timed $timed_flags |
echo -n ' timed'; timed $timed_flags |
fi |
fi |
|
|
if [ "X${ntpd_flags}" != X"NO" ]; then |
if [ X"${ntpd_flags}" != X"NO" ]; then |
# since this is system startup, use -s |
# since this is system startup, use -s |
echo -n ' ntpd'; ntpd -s $ntpd_flags |
echo -n ' ntpd'; ntpd -s $ntpd_flags |
fi |
fi |
|
|
savecore ${savecore_flags} /var/crash |
savecore ${savecore_flags} /var/crash |
fi |
fi |
|
|
if [ "X${afs}" = X"YES" -a -c /dev/xfs0 ]; then |
if [ X"${afs}" = X"YES" -a -c /dev/xfs0 ]; then |
echo -n 'mounting afs:' |
echo -n 'mounting afs:' |
mkdir -p -m 0755 /afs |
mkdir -p -m 0755 /afs |
mount -t xfs /dev/xfs0 /afs |
mount -t xfs /dev/xfs0 /afs |
|
|
echo ' done.' |
echo ' done.' |
fi |
fi |
|
|
if [ "X${check_quotas}" = X"YES" ]; then |
if [ X"${check_quotas}" = X"YES" ]; then |
echo -n 'checking quotas:' |
echo -n 'checking quotas:' |
quotacheck -a |
quotacheck -a |
echo ' done.' |
echo ' done.' |
|
|
fi |
fi |
|
|
[ -f /etc/rc.securelevel ] && . /etc/rc.securelevel |
[ -f /etc/rc.securelevel ] && . /etc/rc.securelevel |
if [ X${securelevel} != X"" ]; then |
if [ X"${securelevel}" != X"" ]; then |
echo -n 'setting kernel security level: ' |
echo -n 'setting kernel security level: ' |
sysctl kern.securelevel=${securelevel} |
sysctl kern.securelevel=${securelevel} |
fi |
fi |
|
|
|
|
# $routed_flags are imported from /etc/rc.conf. |
# $routed_flags are imported from /etc/rc.conf. |
# If $routed_flags == NO, routed isn't run. |
# If $routed_flags == NO, routed isn't run. |
if [ "X${routed_flags}" != X"NO" ]; then |
if [ X"${routed_flags}" != X"NO" ]; then |
echo -n ' routed'; routed $routed_flags |
echo -n ' routed'; routed $routed_flags |
fi |
fi |
|
|
# $mrouted_flags is imported from /etc/rc.conf; |
# $mrouted_flags is imported from /etc/rc.conf; |
# If $mrouted_flags == NO, then mrouted isn't run. |
# If $mrouted_flags == NO, then mrouted isn't run. |
if [ "X${mrouted_flags}" != X"NO" ]; then |
if [ X"${mrouted_flags}" != X"NO" ]; then |
echo -n ' mrouted'; mrouted $mrouted_flags |
echo -n ' mrouted'; mrouted $mrouted_flags |
fi |
fi |
|
|
if [ "X${ospfd_flags}" != X"NO" ]; then |
if [ X"${ospfd_flags}" != X"NO" ]; then |
echo -n ' ospfd'; /usr/sbin/ospfd $ospfd_flags |
echo -n ' ospfd'; /usr/sbin/ospfd $ospfd_flags |
fi |
fi |
|
|
if [ "X${bgpd_flags}" != X"NO" ]; then |
if [ X"${bgpd_flags}" != X"NO" ]; then |
echo -n ' bgpd'; /usr/sbin/bgpd $bgpd_flags |
echo -n ' bgpd'; /usr/sbin/bgpd $bgpd_flags |
fi |
fi |
|
|
# $dhcpd_flags is imported from /etc/rc.conf |
# $dhcpd_flags is imported from /etc/rc.conf |
# If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run. |
# If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run. |
if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then |
if [ X"${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then |
touch /var/db/dhcpd.leases |
touch /var/db/dhcpd.leases |
if [ -f /etc/dhcpd.interfaces ]; then |
if [ -f /etc/dhcpd.interfaces ]; then |
dhcpd_ifs=`stripcom /etc/dhcpd.interfaces` |
dhcpd_ifs=`stripcom /etc/dhcpd.interfaces` |
|
|
|
|
if ifconfig lo0 inet6 >/dev/null 2>&1; then |
if ifconfig lo0 inet6 >/dev/null 2>&1; then |
fw=`sysctl -n net.inet6.ip6.forwarding` |
fw=`sysctl -n net.inet6.ip6.forwarding` |
if [ "X${fw}" == X"0" ]; then |
if [ X"${fw}" = X"0" ]; then |
# $rtsold_flags is imported from /etc/rc.conf; |
# $rtsold_flags is imported from /etc/rc.conf; |
# If $rtsold_flags == NO, then rtsold isn't run. |
# If $rtsold_flags == NO, then rtsold isn't run. |
if [ "X${rtsold_flags}" != X"NO" ]; then |
if [ X"${rtsold_flags}" != X"NO" ]; then |
echo -n ' rtsold' |
echo -n ' rtsold' |
/usr/sbin/rtsold ${rtsold_flags} |
/usr/sbin/rtsold ${rtsold_flags} |
fi |
fi |
else |
else |
# $route6d_flags is imported from /etc/rc.conf; |
# $route6d_flags is imported from /etc/rc.conf; |
# If $route6d_flags == NO, then route6d isn't run. |
# If $route6d_flags == NO, then route6d isn't run. |
if [ "X${route6d_flags}" != X"NO" ]; then |
if [ X"${route6d_flags}" != X"NO" ]; then |
echo -n ' route6d' |
echo -n ' route6d' |
/usr/sbin/route6d ${route6d_flags} |
/usr/sbin/route6d ${route6d_flags} |
fi |
fi |
# $rtadvd_flags is imported from /etc/rc.conf; |
# $rtadvd_flags is imported from /etc/rc.conf; |
# If $rtadvd_flags == NO, then rtadvd isn't run. |
# If $rtadvd_flags == NO, then rtadvd isn't run. |
if [ "X${rtadvd_flags}" != X"NO" ]; then |
if [ X"${rtadvd_flags}" != X"NO" ]; then |
echo -n ' rtadvd' |
echo -n ' rtadvd' |
/usr/sbin/rtadvd ${rtadvd_flags} |
/usr/sbin/rtadvd ${rtadvd_flags} |
fi |
fi |
|
|
|
|
# $rwhod is imported from /etc/rc.conf; |
# $rwhod is imported from /etc/rc.conf; |
# if $rwhod == YES, rwhod is run. |
# if $rwhod == YES, rwhod is run. |
if [ X${rwhod} = X"YES" ]; then |
if [ X"${rwhod}" = X"YES" ]; then |
echo -n ' rwhod'; rwhod |
echo -n ' rwhod'; rwhod |
fi |
fi |
|
|
|
|
if [ "X${lpd_flags}" != X"NO" ]; then |
if [ X"${lpd_flags}" != X"NO" ]; then |
echo -n ' printer'; lpd ${lpd_flags} |
echo -n ' printer'; lpd ${lpd_flags} |
fi |
fi |
|
|
|
|
# sendmail isn't run. We call sendmail with a full path so that |
# sendmail isn't run. We call sendmail with a full path so that |
# SIGHUP works. Note that /usr/sbin/sendmail may actually call a |
# SIGHUP works. Note that /usr/sbin/sendmail may actually call a |
# mailer other than sendmail, depending on /etc/mailer.conf. |
# mailer other than sendmail, depending on /etc/mailer.conf. |
if [ "X${sendmail_flags}" != X"NO" -a -s /etc/mailer.conf ]; then |
if [ X"${sendmail_flags}" != X"NO" -a -s /etc/mailer.conf ]; then |
echo -n ' sendmail'; ( /usr/sbin/sendmail ${sendmail_flags} >/dev/null 2>&1 & ) |
echo -n ' sendmail'; ( /usr/sbin/sendmail ${sendmail_flags} >/dev/null 2>&1 & ) |
fi |
fi |
|
|
if [ "X${httpd_flags}" != X"NO" ]; then |
if [ X"${httpd_flags}" != X"NO" ]; then |
# Clean up left-over httpd locks |
# Clean up left-over httpd locks |
rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.* |
rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.* |
echo -n ' httpd'; /usr/sbin/httpd ${httpd_flags} |
echo -n ' httpd'; /usr/sbin/httpd ${httpd_flags} |
fi |
fi |
|
|
if [ "X${ftpd_flags}" != X"NO" ]; then |
if [ X"${ftpd_flags}" != X"NO" ]; then |
echo -n ' ftpd'; /usr/libexec/ftpd ${ftpd_flags} |
echo -n ' ftpd'; /usr/libexec/ftpd ${ftpd_flags} |
fi |
fi |
|
|
if [ "X${identd_flags}" != X"NO" ]; then |
if [ X"${identd_flags}" != X"NO" ]; then |
echo -n ' identd'; /usr/libexec/identd ${identd_flags} |
echo -n ' identd'; /usr/libexec/identd ${identd_flags} |
fi |
fi |
|
|
if [ X${inetd} = X"YES" -a -e /etc/inetd.conf ]; then |
if [ X"${inetd}" = X"YES" -a -e /etc/inetd.conf ]; then |
echo -n ' inetd'; inetd |
echo -n ' inetd'; inetd |
fi |
fi |
|
|
|
|
echo -n ' sshd'; /usr/sbin/sshd ${sshd_flags}; |
echo -n ' sshd'; /usr/sbin/sshd ${sshd_flags}; |
fi |
fi |
|
|
if [ "X${spamd_flags}" != X"NO" ]; then |
if [ X"${spamd_flags}" != X"NO" ]; then |
if [ "X${spamd_grey}" != X"NO" ]; then |
if [ X"${spamd_grey}" != X"NO" ]; then |
spamd_flags="${spamd_flags} -g" |
spamd_flags="${spamd_flags} -g" |
fi |
fi |
echo -n ' spamd'; eval /usr/libexec/spamd ${spamd_flags} |
echo -n ' spamd'; eval /usr/libexec/spamd ${spamd_flags} |
/usr/libexec/spamd-setup |
/usr/libexec/spamd-setup |
if [ "X${spamd_grey}" != X"NO" ]; then |
if [ X"${spamd_grey}" != X"NO" ]; then |
echo -n ' spamlogd' |
echo -n ' spamlogd' |
/usr/libexec/spamlogd ${spamlogd_flags} |
/usr/libexec/spamlogd ${spamlogd_flags} |
fi |
fi |
|
|
# $rarpd_flags is imported from /etc/rc.conf; |
# $rarpd_flags is imported from /etc/rc.conf; |
# If $rarpd_flags == NO or /etc/ethers doesn't exist, then |
# If $rarpd_flags == NO or /etc/ethers doesn't exist, then |
# rarpd isn't run. |
# rarpd isn't run. |
if [ "X${rarpd_flags}" != X"NO" -a -s /etc/ethers ]; then |
if [ X"${rarpd_flags}" != X"NO" -a -s /etc/ethers ]; then |
echo -n ' rarpd'; rarpd ${rarpd_flags} |
echo -n ' rarpd'; rarpd ${rarpd_flags} |
fi |
fi |
|
|
# $bootparamd_flags is imported from /etc/rc.conf; |
# $bootparamd_flags is imported from /etc/rc.conf; |
# If $bootparamd_flags == NO or /etc/bootparams doesn't exist, then |
# If $bootparamd_flags == NO or /etc/bootparams doesn't exist, then |
# bootparamd isn't run. |
# bootparamd isn't run. |
if [ "X${bootparamd_flags}" != X"NO" -a -s /etc/bootparams ]; then |
if [ X"${bootparamd_flags}" != X"NO" -a -s /etc/bootparams ]; then |
echo -n ' rpc.bootparamd'; rpc.bootparamd ${bootparamd_flags} |
echo -n ' rpc.bootparamd'; rpc.bootparamd ${bootparamd_flags} |
fi |
fi |
|
|
# $rbootd_flags is imported from /etc/rc.conf; |
# $rbootd_flags is imported from /etc/rc.conf; |
# If $rbootd_flags == NO or /etc/rbootd.conf doesn't exist, then |
# If $rbootd_flags == NO or /etc/rbootd.conf doesn't exist, then |
# rbootd isn't run. |
# rbootd isn't run. |
if [ "X${rbootd_flags}" != X"NO" -a -s /etc/rbootd.conf ]; then |
if [ X"${rbootd_flags}" != X"NO" -a -s /etc/rbootd.conf ]; then |
echo -n ' rbootd'; rbootd ${rbootd_flags} |
echo -n ' rbootd'; rbootd ${rbootd_flags} |
fi |
fi |
|
|
# $mopd_flags is imported from /etc/rc.conf; |
# $mopd_flags is imported from /etc/rc.conf; |
# If $mopd_flags == NO or /tftpboot/mop doesn't exist, then |
# If $mopd_flags == NO or /tftpboot/mop doesn't exist, then |
# mopd isn't run. |
# mopd isn't run. |
if [ "X${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then |
if [ X"${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then |
echo -n ' mopd'; mopd ${mopd_flags} |
echo -n ' mopd'; mopd ${mopd_flags} |
fi |
fi |
|
|
|
|
fi |
fi |
|
|
# KerberosV master KDC |
# KerberosV master KDC |
if [ X${krb5_master_kdc} = X"YES" ]; then |
if [ X"${krb5_master_kdc}" = X"YES" ]; then |
echo 'KerberosV master KDC' |
echo 'KerberosV master KDC' |
/usr/libexec/kdc & |
/usr/libexec/kdc & |
/usr/libexec/kadmind & |
/usr/libexec/kadmind & |
|
|
fi |
fi |
|
|
# KerberosV slave KDC |
# KerberosV slave KDC |
if [ X${krb5_slave_kdc} = X"YES" ]; then |
if [ X"${krb5_slave_kdc}" = X"YES" ]; then |
echo 'KerberosV slave KDC' |
echo 'KerberosV slave KDC' |
/usr/libexec/kdc & |
/usr/libexec/kdc & |
# Remember to enable hpropd in inetd.conf |
# Remember to enable hpropd in inetd.conf |
|
|
|
|
# $apmd_flags is imported from /etc/rc.conf; |
# $apmd_flags is imported from /etc/rc.conf; |
# don't run daemon if $apmd_flags == NO or /usr/sbin/apmd doesn't exist |
# don't run daemon if $apmd_flags == NO or /usr/sbin/apmd doesn't exist |
if [ "X${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then |
if [ X"${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then |
echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags} |
echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags} |
fi |
fi |
|
|
|
|
|
|
date |
date |
|
|
if [ "X${wsmoused_flags}" != X"NO" -a -x /usr/sbin/wsmoused ]; then |
if [ X"${wsmoused_flags}" != X"NO" -a -x /usr/sbin/wsmoused ]; then |
echo 'starting wsmoused...'; /usr/sbin/wsmoused ${wsmoused_flags} |
echo 'starting wsmoused...'; /usr/sbin/wsmoused ${wsmoused_flags} |
fi |
fi |
|
|
# Alternatively, on some architectures, xdm may be started in /etc/ttys. |
# Alternatively, on some architectures, xdm may be started in /etc/ttys. |
if [ "X${xdm_flags}" != X"NO" ]; then |
if [ X"${xdm_flags}" != X"NO" ]; then |
echo 'starting xdm...'; /usr/X11R6/bin/xdm ${xdm_flags} |
echo 'starting xdm...'; /usr/X11R6/bin/xdm ${xdm_flags} |
fi |
fi |
|
|