Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/etc/rc.d pull up rev 1.1 (approved by thorpej):



details:   https://anonhg.NetBSD.org/src/rev/61ed31d005d8
branches:  netbsd-1-5
changeset: 489213:61ed31d005d8
user:      lukem <lukem%NetBSD.org@localhost>
date:      Wed Aug 23 12:08:17 2000 +0000

description:
pull up rev 1.1 (approved by thorpej):
migrate raising of securelevel from sysctl to separate securelevel
script.  the latter depends upon aftermountlkm (but is required by
DAEMON), so that lkms may be loaded before the securelevel is
raised.  noted by Rafal Boni <rafal%mediaone.net@localhost> in [bin/10780]

diffstat:

 etc/rc.d/securelevel |  33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r ab8663d2aced -r 61ed31d005d8 etc/rc.d/securelevel
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/securelevel      Wed Aug 23 12:08:17 2000 +0000
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# $NetBSD: securelevel,v 1.1.2.2 2000/08/23 12:08:17 lukem Exp $
+#
+
+# PROVIDE: securelevel
+# REQUIRE: aftermountlkm
+
+. /etc/rc.subr
+
+name="securelevel"
+start_cmd="securelevel_start"
+stop_cmd=":"
+
+securelevel_start()
+{
+       #       if $securelevel is set, change it here, else if it is 0,
+       #       change it to 1 here, before we start daemons or login services.
+       #
+       if [ -n "$securelevel" ]; then
+               echo -n "Setting securelevel: "
+               sysctl -w kern.securelevel=$securelevel
+       else
+               securelevel=`sysctl -n kern.securelevel`
+               if [ x"$securelevel" = x0 ]; then
+                       echo -n "Setting securelevel: "
+                       sysctl -w kern.securelevel=1
+               fi
+       fi
+}
+
+load_rc_config $name
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index