summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/sysctl
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-23 22:06:28 +0000
committermtm <mtm@FreeBSD.org>2008-06-23 22:06:28 +0000
commit5b37d9eba744dee55431a0426bafd09eef483fea (patch)
tree143050b4a26dfcca36087688ac911ef3e62dfd91 /etc/rc.d/sysctl
parent437891381c13fcfea1097ae4d151f60dbcd8f601 (diff)
downloadFreeBSD-src-5b37d9eba744dee55431a0426bafd09eef483fea.zip
FreeBSD-src-5b37d9eba744dee55431a0426bafd09eef483fea.tar.gz
The sysctl(8) program exits on some errors and only emits warnings on
others. In the case where it displayed warnings it would still return succesfully. Modify it so that it returns the number of sysctls that it was not able to set. Make use of this in rc.d to display only *unsuccessfull* attempts to set sysctls.
Diffstat (limited to 'etc/rc.d/sysctl')
-rw-r--r--etc/rc.d/sysctl4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl
index f83d7f8..c55cc84 100644
--- a/etc/rc.d/sysctl
+++ b/etc/rc.d/sysctl
@@ -36,7 +36,9 @@ sysctl_start()
${val})
;;
*)
- sysctl "${var}"
+ if ! sysctl "${var}" >/dev/null 2>&1; then
+ warn "unable to set ${var}"
+ fi
;;
esac
elif [ "$1" = "last" ]; then
OpenPOWER on IntegriCloud