Module Name: src
Committed By: elad
Date: Tue Dec 29 17:06:11 UTC 2009
Modified Files:
src/etc/rc.d: securelevel
Log Message:
Securelevel might not be present, properly complain instead of
printing
error messages from sysctl(8).
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/etc/rc.d/securelevel
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/etc/rc.d/securelevel
diff -u src/etc/rc.d/securelevel:1.7 src/etc/rc.d/securelevel:1.8
--- src/etc/rc.d/securelevel:1.7 Wed Nov 12 12:35:52 2008
+++ src/etc/rc.d/securelevel Tue Dec 29 17:06:10 2009
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: securelevel,v 1.7 2008/11/12 12:35:52 ad Exp $
+# $NetBSD: securelevel,v 1.8 2009/12/29 17:06:10 elad Exp $
#
# PROVIDE: securelevel
@@ -19,7 +19,12 @@
# it is 0, change it to 1 here, before we start daemons
# or login services.
#
- osecurelevel=$(sysctl -n kern.securelevel)
+ osecurelevel=$(sysctl -n kern.securelevel 2>&-)
+ if [ $? != 0 ]; then
+ echo "Can't set securelevel. (kern.securelevel sysctl not
present.)"