If foo_flags is DEFAULT, run the program with a default set of flags. Most

users will use this, and therefore will never have to worry about flags
changing between releases.  It's also a bit less error-prone.
This commit is contained in:
mycroft 1997-03-10 09:16:13 +00:00
parent dc1020fe40
commit 2069c0127b
2 changed files with 131 additions and 59 deletions

131
etc/rc
View File

@ -1,4 +1,4 @@
# $NetBSD: rc,v 1.66 1997/03/10 06:32:37 scottr Exp $
# $NetBSD: rc,v 1.67 1997/03/10 09:16:13 mycroft Exp $
# from: @(#)rc 8.2 (Berkeley) 3/17/94
# System startup script run by init on autoboot
@ -75,7 +75,7 @@ echo 'setting tty flags'
ttyflags -a
# load any kernel modules specified in /etc/lkm.conf
if [ X"$lkm_init" != XNO -a -f /etc/rc.lkm ]; then
if [ "$lkm_init" != NO ] && [ -f /etc/rc.lkm ]; then
. /etc/rc.lkm
fi
@ -95,13 +95,19 @@ rm -f /var/spool/uucp/STST/*
# start the system logger first, so that all messages
# from daemons are logged, and the name server next.
if [ "X$syslogd_flags" != XNO ]; then
if [ "$syslogd_flags" != NO ]; then
if [ "$syslogd_flags" = DEFAULT ]; then
syslogd_flags=""
fi
echo 'starting system logger'
rm -f /dev/log
syslogd $syslogd_flags
fi
if [ "X$named_flags" != XNO ]; then
if [ "$named_flags" != NO ]; then
if [ "$named_flags" = DEFAULT ]; then
named_flags=""
fi
echo 'starting name server'; named $named_flags
fi
@ -109,54 +115,79 @@ fi
echo -n 'starting rpc daemons:'
# note that portmap is generally required for all other rpc services.
if [ "X$portmap" != XNO ]; then
if [ "$portmap" != NO ]; then
echo -n ' portmap'; portmap
fi
if [ "X$ypserv_flags" != XNO ]; then
if [ "$ypserv_flags" != NO ]; then
if [ "$ypserv_flags" = DEFAULT ]; then
ypserv_flags="-d"
fi
echo -n ' ypserv'; ypserv $ypserv_flags
fi
if [ "X$ypbind_flags" != XNO ]; then
if [ "$ypbind_flags" != NO ]; then
if [ "$ypbind_flags" = DEFAULT ]; then
ypbind_flags=""
fi
echo -n ' ypbind'; ypbind $ypbind_flags
fi
if [ "X$yppasswdd_flags" != XNO ]; then
if [ "$yppasswdd_flags" != NO ]; then
if [ "$yppasswdd_flags" = DEFAULT ]; then
yppasswdd_flags=""
fi
echo -n ' rpc.yppasswdd'; rpc.yppasswdd $yppasswdd_flags
fi
if [ "X$bootparamd_flags" != XNO -a -r /etc/bootparams ]; then
if [ "$bootparamd_flags" != NO ] && [ -r /etc/bootparams ]; then
if [ "$bootparamd_flags" = DEFAULT ]; then
bootparamd_flags=""
fi
echo -n ' rpc.bootparamd'; rpc.bootparamd $bootparamd_flags
fi
if [ "X$nfs_server" = XYES -a -r /etc/exports ]; then
if [ "X$nfsd_flags" = X ]; then
nfs_locking=NO
if [ "$nfs_server" = YES ] && [ -r /etc/exports ]; then
if [ "$nfsd_flags" = DEFAULT ]; then
nfsd_flags="-tun 4"
fi
rm -f /var/db/mountdtab
echo -n > /var/db/mountdtab
echo -n ' mountd'; mountd $mountd_flags
echo -n ' nfsd'; nfsd $nfsd_flags
nfs_locking=MAYBE
fi
if [ "X$nfs_client" = XYES ]; then
if [ "X$nfsiod_flags" = X ]; then
if [ "$nfs_client" = YES ]; then
if [ "$nfsiod_flags" = DEFAULT ]; then
nfsiod_flags="-n 4"
fi
echo -n ' nfsiod'; nfsiod $nfsiod_flags
nfs_locking=MAYBE
fi
if [ "X$nfs_server" = XYES -a -r /etc/exports -o "X$nfs_client" = XYES ]; then
if [ "X$statd_flags" != XNO ]; then
if [ "$nfs_locking" != NO ]; then
if [ "$statd_flags" != NO ]; then
if [ "$statd_flags" = DEFAULT ]; then
statd_flags=""
fi
echo ' statd'; rpc.statd $statd_flags
fi
if [ "X$lockd_flags" != XNO ]; then
if [ "$lockd_flags" != NO ]; then
if [ "$lockd_flags" = DEFAULT ]; then
lockd_flags=""
fi
echo ' lockd'; rpc.lockd $lockd_flags
fi
fi
if [ "X$amd" = XYES -a -d "$amd_dir" -a -r "$amd_master" ]; then
if [ "$amd_flags" != NO ] && [ -d "$amd_dir" -a -r "$amd_master" ]; then
if [ "$amd_flags" = DEFAULT ]; then
amd_flags="-l syslog -x error,noinfo,nostats"
fi
echo -n ' amd'
amd $amd_flags -p -a $amd_dir `cat $amd_master` > /var/run/amd.pid
fi
@ -175,7 +206,10 @@ fi
# /var/crash should be a directory or a symbolic link
# to the crash directory if core dumps are to be saved.
if [ X"$savecore_flags" != XNO -a -d /var/crash ]; then
if [ "$savecore_flags" != NO ] && [ -d /var/crash ]; then
if [ "$savecore_flags" = DEFAULT ]; then
savecore_flags=""
fi
echo checking for core dump...
savecore $savecore_flags /var/crash
fi
@ -227,50 +261,83 @@ echo '.'
# now start all the other daemons
echo -n starting network daemons:
if [ X$gated_flags != XNO -a -r /etc/gated.conf ]; then
if [ "$gated_flags" != NO ] && [ -r /etc/gated.conf ]; then
if [ "$gated_flags" = DEFAULT ]; then
gated_flags=""
fi
echo -n ' gated'; gated $gated_flags
elif [ "X$routed_flags" != XNO ]; then
elif [ "$routed_flags" != NO ]; then
if [ "$routed_flags" = DEFAULT ]; then
routed_flags="-q"
fi
echo -n ' routed'; routed $routed_flags
fi
if [ "X$mrouted_flags" != XNO ]; then
if [ "$mrouted_flags" != NO ]; then
if [ "$mrouted_flags" = DEFAULT ]; then
mrouted_flags=""
fi
echo -n ' mrouted'; mrouted $mrouted_flags
fi
if [ "X$timed_flags" != XNO ]; then
echo -n ' time daemon'; timed $timed_flags
if [ "$timed_flags" != NO ]; then
if [ "$timed_flags" = DEFAULT ]; then
timed_flags=""
fi
echo -n ' timed'; timed $timed_flags
fi
if [ "X$xntpd_flags" != XNO ]; then
echo -n ' ntp daemon'; xntpd $xntpd_flags
if [ "$xntpd_flags" != NO ]; then
if [ "$xntpd_flags" = DEFAULT ]; then
xntpd_flags=""
fi
echo -n ' xntpd'; xntpd $xntpd_flags
fi
if [ "X$dhcpd_flags" != XNO -a -r /etc/dhcpd.conf ]; then
if [ "$dhcpd_flags" != NO ] && [ -r /etc/dhcpd.conf ]; then
if [ "$dhcpd_flags" = DEFAULT ]; then
dhcpd_flags=""
fi
echo -n ' dhcpd'; dhcpd $dhcpd_flags
fi
if [ X$rwhod = XYES ]; then
if [ "$rwhod" = YES ]; then
echo -n ' rwhod'; rwhod
fi
if [ "X$lpd_flags" != XNO ]; then
if [ "$lpd_flags" != NO ]; then
if [ "$lpd_flags" = DEFAULT ]; then
lpd_flags=""
fi
echo -n ' printer'; lpd $lpd_flags
fi
# We call sendmail with a full path so that SIGHUP works.
if [ "X$sendmail_flags" != XNO -a -r /etc/sendmail.cf ]; then
if [ "$sendmail_flags" != NO ] && [ -r /etc/sendmail.cf ]; then
if [ "$sendmail_flags" = DEFAULT ]; then
sendmail_flags="-bd -q30m"
fi
echo -n ' sendmail'; /usr/sbin/sendmail $sendmail_flags
fi
if [ "X$rarpd_flags" != XNO -a -r /etc/ethers ]; then
if [ "$rarpd_flags" != NO ] && [ -r /etc/ethers ]; then
if [ "$rarpd_flags" = DEFAULT ]; then
rarpd_flags="-a"
fi
echo -n ' rarpd'; rarpd $rarpd_flags
fi
if [ "X$rbootd_flags" != XNO -a -r /etc/rbootd.conf ]; then
if [ "$rbootd_flags" != NO ] && [ -r /etc/rbootd.conf ]; then
if [ "$rbootd_flags" = DEFAULT ]; then
rbootd_flags=""
fi
echo -n ' rbootd'; rbootd $rbootd_flags
fi
if [ "X$inetd_flags" != XNO -a -r /etc/inetd.conf ]; then
if [ "$inetd_flags" != NO ] && [ -r /etc/inetd.conf ]; then
if [ "$inetd_flags" = DEFAULT ]; then
inetd_flags=""
fi
echo -n ' inetd'; inetd $inetd_flags
fi

View File

@ -1,43 +1,48 @@
# $NetBSD: rc.conf,v 1.2 1997/03/10 06:32:38 scottr Exp $
# $NetBSD: rc.conf,v 1.3 1997/03/10 09:16:14 mycroft Exp $
#
# see rc.conf(5) for more information.
# uncomment this if you want to use local paths in rc
#export PATH=$PATH:/usr/local/sbin:/usr/local/bin
# set these to "NO" to turn them off. otherwise, they're used as flags
# `NO' disables a toggle or a program with flags.
# `YES' enables a toggle.
# `DEFAULT' enables a program with the default flags (as listed).
# Any other string is used as a set of flags.
ipfilter=NO # YES or NO.
lkm_init=YES # YES or NO.
syslogd_flags="" # for 'normal' use: syslogd_flags=""
named_flags=NO # for 'normal' use: named_flags=""
syslogd_flags=DEFAULT # default: ""
named_flags=NO # default: ""
portmap=YES # YES or NO; normally required.
ypserv_flags=NO # for 'normal' use: ypserv_flags="-d"
ypbind_flags=NO # for 'normal' use: ypbind_flags=""
yppasswdd_flags=NO # for 'normal' use: yppasswdd_flags=""
bootparamd_flags=NO # for 'normal' use: bootparamd_flags=""
ypserv_flags=NO # default: "-d"
ypbind_flags=NO # default: ""
yppasswdd_flags=NO # default: ""
bootparamd_flags=NO # default: ""
nfs_server=NO # YES or NO.
nfsd_flags="" # for 'normal' use: nfsd_flags="-tun 4"
mountd_flags="" # for 'normal' use: mountd_flags=""
nfsd_flags=DEFAULT # default: "-tun 4"
mountd_flags=DEFAULT # default: ""
nfs_client=NO # YES or NO.
nfsiod_flags="" # for 'normal use: nfsiod_flags="-n 4"
statd_flags=NO # for 'normal' use: statd_flags=""
lockd_flags=NO # for 'normal' use: lockd_flags=""
amd=NO # YES or NO.
amd_flags="" # for 'normal use: amd_flags="-l syslog -x error,noinfo,nostats"
nfsiod_flags=DEFAULT # default: "-n 4"
statd_flags=NO # default: ""
lockd_flags=NO # default: ""
amd_flags=NO # default: "-l syslog -x error,noinfo,nostats"
amd_dir=/amd # AMD's mount directory
amd_master=/etc/amd/master # AMD 'master' map
timed_flags=NO # for 'normal' use: timed_flags=""
xntpd_flags=NO # for 'normal' use: xntpd_flags=""
savecore_flags="" # for 'normal' use: savecore_flags=""
savecore_flags=DEFAULT # default: ""
gated=NO # YES or NO.
gated_flags=NO # note: gated is not distributed with NetBSD.
routed_flags=-q # for 'normal' use: routed_flags="-q"
mrouted_flags=NO # for 'normal' use: mrouted_flags=""
dhcpd_flags=NO # for 'normal' use: dhcpd_flags=""
# NOTE: gated is not distributed with NetBSD.
gated_flags=NO # default: ""
routed_flags=DEFAULT # default: "-q"
mrouted_flags=NO # default: ""
timed_flags=NO # default: ""
xntpd_flags=NO # default: ""
dhcpd_flags=NO # default: ""
rwhod=NO # YES or NO.
lpd_flags="" # for 'normal use: lpd_flags=""
sendmail_flags=NO # for 'normal' use: sendmail_flags="-bd -q30m"
rarpd_flags=NO # for 'normal' use: rarpd_flags="-a"
rbootd_flags=NO # for 'normal' use: rbootd_flags=""
inetd_flags="" # for libwrap logging, use: inetd_flags=-l
lpd_flags=DEFAULT # default: ""
sendmail_flags=NO # default: "-bd -q30m"
rarpd_flags=NO # default: "-a"
rbootd_flags=NO # default: ""
# NOTE: for libwrap logging, use `-l'.
inetd_flags=DEFAULT # default: ""
kerberos_server=NO