summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/sysctl
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.d/sysctl')
-rw-r--r--etc/rc.d/sysctl47
1 files changed, 37 insertions, 10 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl
index 8b1f447..90c4f2c 100644
--- a/etc/rc.d/sysctl
+++ b/etc/rc.d/sysctl
@@ -1,13 +1,40 @@
#!/bin/sh
#
-# Read in /etc/sysctl.conf and set things accordingly
+# $NetBSD: sysctl,v 1.8 2000/06/13 16:29:55 itojun Exp $
#
-# $Id:$
-if [ -f /etc/sysctl.conf ]; then
- 3< /etc/sysctl.conf
- while read 0<&3 var;
- do
- sysctl -w $var
- done
- 3<&-
-fi
+
+# PROVIDE: sysctl
+# REQUIRE: root ipfilter ipsec
+
+. /etc/rc.subr
+
+name="sysctl"
+start_cmd="sysctl_start"
+stop_cmd=":"
+
+sysctl_start()
+{
+ if [ -n "$defcorename" ]; then
+ cat <<__EOF__
+*** WARNING: /etc/rc.conf \$defcorename setting is obsolete. Please
+*** set kern.defcorename in /etc/sysctl.conf
+__EOF__
+ sysctl -w kern.defcorename=$defcorename
+ fi
+
+ if [ -n "$nfsiod_flags" ]; then
+ cat <<__EOF__
+*** WARNING: /etc/rc.conf \$nfsiod_flags setting is obsolete. Please
+*** remove it. If it was set to other than the default of "-n 4", then
+*** set vfs.nfs.iothreads in /etc/sysctl.conf
+__EOF__
+ fi
+
+ if [ -r /etc/sysctl.conf ]; then
+ echo "Setting sysctl variables:"
+ sysctl -f /etc/sysctl.conf
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
OpenPOWER on IntegriCloud