aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Makonnen <mtm@FreeBSD.org>2004-01-17 10:40:45 +0000
committerMike Makonnen <mtm@FreeBSD.org>2004-01-17 10:40:45 +0000
commit9dd342fee6bfd0dd8d11ac881541c9f47c27448e (patch)
tree99720b9841634a9c5e100113c18279be9db362fb
parent45550658617bab1a5e2228cc0adb133e5e76aea0 (diff)
Notes
-rwxr-xr-xetc/rc.d/amd67
-rwxr-xr-xetc/rc.d/bootparams10
-rwxr-xr-xetc/rc.d/cleartmp18
-rwxr-xr-xetc/rc.d/dhclient18
-rwxr-xr-xetc/rc.d/fsck24
-rwxr-xr-xetc/rc.d/ipfilter135
-rwxr-xr-xetc/rc.d/ipfs9
-rwxr-xr-xetc/rc.d/ipmon12
-rwxr-xr-xetc/rc.d/ipnat19
-rwxr-xr-xetc/rc.d/ipsec13
-rw-r--r--etc/rc.d/isdnd11
-rwxr-xr-xetc/rc.d/ldconfig62
-rwxr-xr-xetc/rc.d/lpd8
-rwxr-xr-xetc/rc.d/mountcritlocal63
14 files changed, 130 insertions, 339 deletions
diff --git a/etc/rc.d/amd b/etc/rc.d/amd
index ac7f4b62ac91..6ecf00f9b09f 100755
--- a/etc/rc.d/amd
+++ b/etc/rc.d/amd
@@ -14,53 +14,38 @@
name="amd"
rcvar=`set_rcvar`
command="/usr/sbin/${name}"
-
-case ${OSTYPE} in
-FreeBSD)
- start_precmd="amd_precmd"
- command_args="&"
- ;;
-NetBSD)
- command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid'
- required_dirs="$amd_dir"
- required_files="/etc/amd.conf"
- required_vars="rpcbind"
- ;;
-esac
+start_precmd="amd_precmd"
+command_args="&"
amd_precmd()
{
- case ${OSTYPE} in
- FreeBSD)
- if ! checkyesno nfs_client_enable; then
- force_depend nfsclient || return 1
- fi
+ if ! checkyesno nfs_client_enable; then
+ force_depend nfsclient || return 1
+ fi
- if ! checkyesno rpcbind_enable && \
- ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
- then
- force_depend rpcbind || return 1
- fi
+ if ! checkyesno rpcbind_enable && \
+ ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
+ then
+ force_depend rpcbind || return 1
+ fi
- case ${amd_map_program} in
- [Nn][Oo] | '')
- ;;
- *)
- rc_flags="${rc_flags} `eval ${amd_map_program}`"
- ;;
- esac
+ case ${amd_map_program} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ rc_flags="${rc_flags} `eval ${amd_map_program}`"
+ ;;
+ esac
- case "${amd_flags}" in
- '')
- if [ ! -r /etc/amd.conf ]; then
- warn 'amd will not load without arguments'
- return 1
- fi
- ;;
- *)
- rc_flags="-p ${rc_flags} > /var/run/amd.pid 2> /dev/null" \
- ;;
- esac
+ case "${amd_flags}" in
+ '')
+ if [ ! -r /etc/amd.conf ]; then
+ warn 'amd will not load without arguments'
+ return 1
+ fi
+ ;;
+ *)
+ rc_flags="-p ${rc_flags} > /var/run/amd.pid 2> /dev/null" \
;;
esac
return 0
diff --git a/etc/rc.d/bootparams b/etc/rc.d/bootparams
index d14110018309..5e11abbc326d 100755
--- a/etc/rc.d/bootparams
+++ b/etc/rc.d/bootparams
@@ -14,15 +14,7 @@
name="bootparamd"
rcvar=`set_rcvar`
required_files="/etc/bootparams"
-
-case ${OSTYPE} in
-FreeBSD)
- command="/usr/sbin/${name}"
- ;;
-NetBSD)
- command="/usr/sbin/rpc.${name}"
- ;;
-esac
+command="/usr/sbin/${name}"
load_rc_config $name
run_rc_command "$1"
diff --git a/etc/rc.d/cleartmp b/etc/rc.d/cleartmp
index b31856033a53..f51db374e9be 100755
--- a/etc/rc.d/cleartmp
+++ b/etc/rc.d/cleartmp
@@ -32,15 +32,9 @@ cleartmp_start()
load_rc_config $name
run_rc_command "$1"
-case ${OSTYPE} in
-FreeBSD)
- # Remove X lock files, since they will prevent you from
- # restarting X
- #
- rm -f /tmp/.X*-lock
- rm -fr /tmp/.X11-unix
- mkdir -m 1777 /tmp/.X11-unix
- ;;
-NetBSD)
- ;;
-esac
+# Remove X lock files, since they will prevent you from
+# restarting X
+#
+rm -f /tmp/.X*-lock
+rm -fr /tmp/.X11-unix
+mkdir -m 1777 /tmp/.X11-unix
diff --git a/etc/rc.d/dhclient b/etc/rc.d/dhclient
index 7a08b87641a2..f7c9117119d8 100755
--- a/etc/rc.d/dhclient
+++ b/etc/rc.d/dhclient
@@ -17,20 +17,12 @@
. /etc/network.subr
name="dhclient"
+rcvar=
pidfile="/var/run/${name}.pid"
-case "${OSTYPE}" in
-FreeBSD)
- rcvar=
- start_precmd="dhclient_prestart"
- start_postcmd="dhclient_poststart"
- stop_precmd="dhclient_prestop"
- stop_postcmd="dhclient_poststop"
- ;;
-NetBSD)
- rcvar=$name
- command="/sbin/${name}"
- ;;
-esac
+start_precmd="dhclient_prestart"
+start_postcmd="dhclient_poststart"
+stop_precmd="dhclient_prestop"
+stop_postcmd="dhclient_poststop"
dhclient_common()
{
diff --git a/etc/rc.d/fsck b/etc/rc.d/fsck
index 84f953694e33..05ae5636c68d 100755
--- a/etc/rc.d/fsck
+++ b/etc/rc.d/fsck
@@ -34,18 +34,12 @@ fsck_start()
trap : 3
echo "Starting file system checks:"
- case ${OSTYPE} in
- FreeBSD)
- if checkyesno background_fsck; then
- fsck -F -p
- else
- fsck -p
- fi
- ;;
- NetBSD)
+ if checkyesno background_fsck; then
+ fsck -F -p
+ else
fsck -p
- ;;
- esac
+ fi
+ ;;
case $? in
0)
@@ -60,8 +54,6 @@ fsck_start()
stop_boot
;;
8)
- case ${OSTYPE} in
- FreeBSD)
if checkyesno fsck_y_enable; then
echo "File system preen failed, trying fsck -y."
fsck -y
@@ -78,12 +70,6 @@ fsck_start()
stop_boot
fi
;;
- NetBSD)
- echo "Automatic file system check failed; help!"
- stop_boot
- ;;
- esac
- ;;
12)
echo "Boot interrupted."
stop_boot
diff --git a/etc/rc.d/ipfilter b/etc/rc.d/ipfilter
index f1e91fdee600..a17cea6763ee 100755
--- a/etc/rc.d/ipfilter
+++ b/etc/rc.d/ipfilter
@@ -14,15 +14,7 @@
name="ipfilter"
rcvar=`set_rcvar`
load_rc_config $name
-
-case ${OSTYPE} in
-FreeBSD)
- stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}"
- ;;
-NetBSD)
- stop_precmd="test -f /etc/ipf.conf -o -f /etc/ipf6.conf"
- ;;
-esac
+stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}"
start_precmd="ipfilter_prestart"
start_cmd="ipfilter_start"
@@ -37,8 +29,6 @@ extra_commands="reload resync status"
ipfilter_prestart()
{
-case ${OSTYPE} in
-FreeBSD)
# load ipfilter kernel module if needed
if ! kldstat -v | grep "IP Filter" > /dev/null 2>&1; then
if kldload ipl; then
@@ -54,73 +44,35 @@ FreeBSD)
warn 'IP-filter: NO IPF RULES'
return 1
fi
- ;;
-NetBSD)
- if [ ! -f /etc/ipf.conf ] && [ ! -f /etc/ipf6.conf ]; then
- warn "/etc/ipf*.conf not readable; ipfilter start aborted."
- #
- # If booting directly to multiuser, send SIGTERM to
- # the parent (/etc/rc) to abort the boot
- #
- if [ "$autoboot" = yes ]; then
- echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
- kill -TERM $$
- exit 1
- fi
- return 1
- fi
- ;;
-esac
return 0
}
ipfilter_start()
{
echo "Enabling ipfilter."
- case ${OSTYPE} in
- FreeBSD)
- if [ `sysctl -n net.inet.ipf.fr_running` -eq 0 ]; then
- ${ipfilter_program:-/sbin/ipf} -E
- fi
- ${ipfilter_program:-/sbin/ipf} -Fa
- if [ -r "${ipfilter_rules}" ]; then
- ${ipfilter_program:-/sbin/ipf} \
- -f "${ipfilter_rules}" ${ipfilter_flags}
- fi
- ${ipfilter_program:-/sbin/ipf} -6 -Fa
- if [ -r "${ipv6_ipfilter_rules}" ]; then
- ${ipfilter_program:-/sbin/ipf} -6 \
- -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
- fi
- ;;
- NetBSD)
- /sbin/ipf -E -Fa
- if [ -f /etc/ipf.conf ]; then
- /sbin/ipf -f /etc/ipf.conf
- fi
- if [ -f /etc/ipf6.conf ]; then
- /sbin/ipf -6 -f /etc/ipf6.conf
- fi
- ;;
- esac
+ if [ `sysctl -n net.inet.ipf.fr_running` -eq 0 ]; then
+ ${ipfilter_program:-/sbin/ipf} -E
+ fi
+ ${ipfilter_program:-/sbin/ipf} -Fa
+ if [ -r "${ipfilter_rules}" ]; then
+ ${ipfilter_program:-/sbin/ipf} \
+ -f "${ipfilter_rules}" ${ipfilter_flags}
+ fi
+ ${ipfilter_program:-/sbin/ipf} -6 -Fa
+ if [ -r "${ipv6_ipfilter_rules}" ]; then
+ ${ipfilter_program:-/sbin/ipf} -6 \
+ -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
+ fi
}
ipfilter_stop()
{
# XXX - The ipf -D command is not effective for 'lkm's
if [ `sysctl -n net.inet.ipf.fr_running` -eq 1 ]; then
- case ${OSTYPE} in
- FreeBSD)
- echo "Saving firewall state tables"
- ${ipfs_program:-/sbin/ipfs} -W ${ipfs_flags}
- echo "Disabling ipfilter."
- ${ipfilter_program:-/sbin/ipf} -D
- ;;
- NetBSD)
- echo "Disabling ipfilter."
- /sbin/ipf -D
- ;;
- esac
+ echo "Saving firewall state tables"
+ ${ipfs_program:-/sbin/ipfs} -W ${ipfs_flags}
+ echo "Disabling ipfilter."
+ ${ipfilter_program:-/sbin/ipf} -D
fi
}
@@ -128,47 +80,26 @@ ipfilter_reload()
{
echo "Reloading ipfilter rules."
- case ${OSTYPE} in
- FreeBSD)
- ${ipfilter_program:-/sbin/ipf} -I -Fa
- if [ -r "${ipfilter_rules}" ]; then
- ${ipfilter_program:-/sbin/ipf} -I \
- -f "${ipfilter_rules}" ${ipfilter_flags}
- fi
- ${ipfilter_program:-/sbin/ipf} -I -6 -Fa
- if [ -r "${ipv6_ipfilter_rules}" ]; then
- ${ipfilter_program:-/sbin/ipf} -I -6 \
- -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
- fi
- ${ipfilter_program:-/sbin/ipf} -s
- ;;
- NetBSD)
- /sbin/ipf -I -Fa
- if [ -f /etc/ipf.conf ] && ! /sbin/ipf -I -f /etc/ipf.conf; then
- err 1 "reload of ipf.conf failed; not swapping to" \
- " new ruleset."
- fi
- if [ -f /etc/ipf6.conf ] && \
- ! /sbin/ipf -I -6 -f /etc/ipf6.conf; then
- err 1 "reload of ipf6.conf failed; not swapping to" \
- " new ruleset."
- fi
- /sbin/ipf -s
- ;;
- esac
+ ${ipfilter_program:-/sbin/ipf} -I -Fa
+ if [ -r "${ipfilter_rules}" ]; then
+ ${ipfilter_program:-/sbin/ipf} -I \
+ -f "${ipfilter_rules}" ${ipfilter_flags}
+ fi
+ ${ipfilter_program:-/sbin/ipf} -I -6 -Fa
+ if [ -r "${ipv6_ipfilter_rules}" ]; then
+ ${ipfilter_program:-/sbin/ipf} -I -6 \
+ -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
+ fi
+ ${ipfilter_program:-/sbin/ipf} -s
}
ipfilter_resync()
{
- case ${OSTYPE} in
- FreeBSD)
- # Don't resync if ipfilter is not loaded
- if ! kldstat -v | grep "IP Filter" > /dev/null 2>&1; then
- return
- fi
- ;;
- esac
+ # Don't resync if ipfilter is not loaded
+ if ! kldstat -v | grep "IP Filter" > /dev/null 2>&1; then
+ return
+ fi
${ipfilter_program:-/sbin/ipf} -y ${ipfilter_flags}
}
diff --git a/etc/rc.d/ipfs b/etc/rc.d/ipfs
index fe8d15c671b6..230ed8b74ef6 100755
--- a/etc/rc.d/ipfs
+++ b/etc/rc.d/ipfs
@@ -15,14 +15,7 @@ name="ipfs"
rcvar=`set_rcvar`
start_cmd="ipfs_start"
stop_cmd="ipfs_stop"
-case ${OSTYPE} in
-FreeBSD)
- start_precmd="ipfs_prestart"
- ;;
-NetBSD)
- ipfs_program="/usr/sbin/ipfs"
- ;;
-esac
+start_precmd="ipfs_prestart"
ipfs_prestart()
{
diff --git a/etc/rc.d/ipmon b/etc/rc.d/ipmon
index b3d1a51e5625..fe5a2345111c 100755
--- a/etc/rc.d/ipmon
+++ b/etc/rc.d/ipmon
@@ -13,16 +13,8 @@
name="ipmon"
rcvar=`set_rcvar`
-
-case ${OSTYPE} in
-FreeBSD)
- command="/sbin/ipmon"
- start_precmd="ipmon_precmd"
- ;;
-NetBSD)
- command="/usr/sbin/${name}"
- command_args="-D"
-esac
+command="/sbin/ipmon"
+start_precmd="ipmon_precmd"
ipmon_precmd()
{
diff --git a/etc/rc.d/ipnat b/etc/rc.d/ipnat
index 3a73964742d5..5e12ede87000 100755
--- a/etc/rc.d/ipnat
+++ b/etc/rc.d/ipnat
@@ -14,15 +14,6 @@
name="ipnat"
rcvar=`set_rcvar`
load_rc_config $name
-
-case ${OSTYPE} in
-NetBSD)
- ipnat_flags=
- ipnat_rules="/etc/ipnat.conf"
- ipnat_program="/usr/sbin/ipnat"
- ;;
-esac
-
start_precmd="ipnat_precmd"
start_cmd="ipnat_start"
stop_cmd="${ipnat_program} -F -C"
@@ -31,16 +22,6 @@ extra_commands="reload"
ipnat_precmd()
{
- case ${OSTYPE} in
- NetBSD)
- if ! checkyesno ipfilter || [ ! -f /etc/ipf.conf ]; then
- echo "Enabling ipfilter for NAT."
- /sbin/ipf -E -Fa
- fi
- return 0
- ;;
- esac
-
# Make sure ipfilter is loaded before continuing
if ! ${SYSCTL} net.inet.ipf.fr_pass >/dev/null 2>&1; then
if kldload ipl; then
diff --git a/etc/rc.d/ipsec b/etc/rc.d/ipsec
index e220f3571c1b..01b7ab2c0518 100755
--- a/etc/rc.d/ipsec
+++ b/etc/rc.d/ipsec
@@ -21,17 +21,8 @@ stop_precmd="test -f /etc/ipsec.conf"
stop_cmd="ipsec_stop"
reload_cmd="ipsec_reload"
extra_commands="reload"
-
-case ${OSTYPE} in
-FreeBSD)
- ipsec_program="/usr/sbin/setkey"
- # ipsec_file is set by rc.conf
- ;;
-NetBSD)
- ipsec_program="/sbin/setkey"
- ipsec_file="/etc/ipsec.conf"
- ;;
-esac
+ipsec_program="/usr/sbin/setkey"
+# ipsec_file is set by rc.conf
ipsec_prestart()
{
diff --git a/etc/rc.d/isdnd b/etc/rc.d/isdnd
index 5c490b0512ce..2f675def4ba7 100644
--- a/etc/rc.d/isdnd
+++ b/etc/rc.d/isdnd
@@ -15,16 +15,7 @@
name="isdnd"
rcvar=`set_rcvar isdn`
pidfile="/var/run/${name}.pid"
-
-case ${OSTYPE} in
-FreeBSD)
- start_cmd="isdnd_start"
- ;;
-NetBSD)
- command="/usr/sbin/${name}"
- required_files="/etc/isdn/${name}.rc"
- ;;
-esac
+start_cmd="isdnd_start"
isdnd_start()
{
diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig
index 55bc98566b3c..4accff6413d4 100755
--- a/etc/rc.d/ldconfig
+++ b/etc/rc.d/ldconfig
@@ -18,47 +18,35 @@ stop_cmd=":"
ldconfig_start()
{
- case ${OSTYPE} in
- FreeBSD)
- _ins=
- ldconfig=${ldconfig_command}
- checkyesno ldconfig_insecure && _ins="-i"
- if [ -x "${ldconfig_command}" ]; then
- _LDC="/lib /usr/lib"
- for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
+ _ins=
+ ldconfig=${ldconfig_command}
+ checkyesno ldconfig_insecure && _ins="-i"
+ if [ -x "${ldconfig_command}" ]; then
+ _LDC="/lib /usr/lib"
+ for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
+ if [ -r "${i}" ]; then
+ _LDC="${_LDC} ${i}"
+ fi
+ done
+ echo 'ELF ldconfig path:' ${_LDC}
+ ${ldconfig} -elf ${_ins} ${_LDC}
+
+ # Legacy aout support for i386 only
+ case `sysctl -n hw.machine_arch` in
+ i386)
+ # Default the a.out ldconfig path.
+ : ${ldconfig_paths_aout=${ldconfig_paths}}
+ _LDC=/usr/lib/aout
+ for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
fi
done
- echo 'ELF ldconfig path:' ${_LDC}
- ${ldconfig} -elf ${_ins} ${_LDC}
-
- # Legacy aout support for i386 only
- case `sysctl -n hw.machine_arch` in
- i386)
- # Default the a.out ldconfig path.
- : ${ldconfig_paths_aout=${ldconfig_paths}}
- _LDC=/usr/lib/aout
- for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
- if [ -r "${i}" ]; then
- _LDC="${_LDC} ${i}"
- fi
- done
- echo 'a.out ldconfig path:' ${_LDC}
- ${ldconfig} -aout ${_ins} ${_LDC}
- ;;
- esac
- fi
- ;;
- NetBSD)
- if [ -f ${ldconfig_command} ]; then
- echo "Creating a.out runtime link editor directory cache."
- ${ldconfig_command}
- fi
- ;;
- *)
- ;;
- esac
+ echo 'a.out ldconfig path:' ${_LDC}
+ ${ldconfig} -aout ${_ins} ${_LDC}
+ ;;
+ esac
+ fi
}
load_rc_config $name
diff --git a/etc/rc.d/lpd b/etc/rc.d/lpd
index 8b55182e32d2..e28644015806 100755
--- a/etc/rc.d/lpd
+++ b/etc/rc.d/lpd
@@ -16,13 +16,5 @@ rcvar=`set_rcvar`
command="/usr/sbin/${name}"
required_files="/etc/printcap"
-case ${OSTYPE} in
-NetBSD)
- pidfile="/var/run/${name}.pid"
- ;;
-*)
- ;;
-esac
-
load_rc_config $name
run_rc_command "$1"
diff --git a/etc/rc.d/mountcritlocal b/etc/rc.d/mountcritlocal
index 3ea68a6b6236..c0dedb153637 100755
--- a/etc/rc.d/mountcritlocal
+++ b/etc/rc.d/mountcritlocal
@@ -16,49 +16,32 @@ stop_cmd=":"
mountcritlocal_start()
{
- case ${OSTYPE} in
- FreeBSD)
- # Set up the list of network filesystem types for which mounting
- # should be delayed until after network initialization.
- case ${extra_netfs_types} in
- [Nn][Oo])
- ;;
- *)
- netfs_types="${netfs_types} ${extra_netfs_types}"
- ;;
- esac
+ # Set up the list of network filesystem types for which mounting
+ # should be delayed until after network initialization.
+ case ${extra_netfs_types} in
+ [Nn][Oo])
+ ;;
+ *)
+ netfs_types="${netfs_types} ${extra_netfs_types}"
+ ;;
+ esac
- # Mount everything except nfs filesystems.
- mount_excludes='no'
- for i in ${netfs_types}; do
- fstype=${i%:*}
- mount_excludes="${mount_excludes}${fstype},"
- done
- mount_excludes=${mount_excludes%,}
- mount -a -t ${mount_excludes}
+ # Mount everything except nfs filesystems.
+ mount_excludes='no'
+ for i in ${netfs_types}; do
+ fstype=${i%:*}
+ mount_excludes="${mount_excludes}${fstype},"
+ done
+ mount_excludes=${mount_excludes%,}
+ mount -a -t ${mount_excludes}
- case $? in
- 0)
- ;;
- *)
- echo 'Mounting /etc/fstab filesystems failed,' \
- ' startup aborted'
- kill -QUIT $$
- ;;
- esac
+ case $? in
+ 0)
;;
- NetBSD)
- # Mount critical filesystems that are `local'
- # (as specified in $critical_filesystems_local)
- # This usually includes /var.
- #
- mount_critical_filesystems local
-
- # clean up left-over files.
- # this could include the cleanup of lock files and /var/run, etc.
- #
- rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
- (cd /var/run && rm -rf -- *)
+ *)
+ echo 'Mounting /etc/fstab filesystems failed,' \
+ ' startup aborted'
+ kill -QUIT $$
;;
esac
}