summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2007-10-14 10:45:31 +0000
committernetchild <netchild@FreeBSD.org>2007-10-14 10:45:31 +0000
commit4af9918bc0e8f388ffda416ed716c9b17ca6c0fd (patch)
treee7d76e2d64fce20db3bf8837259e3d37e4f7d3ec /etc
parent57a6302920d738a0f943ec56aa7d87683e443246 (diff)
downloadFreeBSD-src-4af9918bc0e8f388ffda416ed716c9b17ca6c0fd.zip
FreeBSD-src-4af9918bc0e8f388ffda416ed716c9b17ca6c0fd.tar.gz
Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components: * sample configuration file for sensorsd * rc(8) script and glue code for sensorsd(8) * sysctl(3) doc fixes for CTL_HW tree * sysctl(3) documentation for hardware sensors * sysctl(8) documentation for hardware sensors * support for the sensor structure for sysctl(8) * rc.conf(5) documentation for starting sensorsd(8) * sensor_attach(9) et al documentation * /sys/kern/kern_sensors.c o sensor_attach(9) API for drivers to register ksensors o sensor_task_register(9) API for the update task o sysctl(3) glue code o hw.sensors shadow tree for sysctl(8) internal magic * <sys/sensors.h> * HW_SENSORS definition for <sys/sysctl.h> * sensors display for systat(1), including documentation * sensorsd(8) and all applicable documentation The userland part of the framework is entirely source-code compatible with OpenBSD 4.1, 4.2 and -current as of today. All sensor readings can be viewed with `sysctl hw.sensors`, monitored in semi-realtime with `systat -sensors` and also logged with `sensorsd`. Submitted by: Constantine A. Murenin <cnst@FreeBSD.org> Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors) Mentored by: syrinx Tested by: many OKed by: kensmith Obtained from: OpenBSD (parts)
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile2
-rw-r--r--etc/defaults/rc.conf2
-rwxr-xr-xetc/rc.d/Makefile2
-rw-r--r--etc/rc.d/sensorsd17
-rw-r--r--etc/sensorsd.conf50
5 files changed, 71 insertions, 2 deletions
diff --git a/etc/Makefile b/etc/Makefile
index fb0e3e8..725dd24 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -17,7 +17,7 @@ BIN1= amd.map apmd.conf auth.conf \
portsnap.conf pf.conf pf.os phones profile protocols \
rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
rc.sendmail rc.shutdown \
- rc.subr remote rpc services shells \
+ rc.subr remote rpc sensorsd.conf services shells \
snmpd.config sysctl.conf syslog.conf \
etc.${MACHINE_ARCH}/ttys \
${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 7a18b9c..f941870 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -40,6 +40,8 @@ kldxref_clobber="NO" # Overwrite old linker.hints at boot.
kldxref_module_path="" # Override kern.module_path. A ';'-delimited list.
powerd_enable="NO" # Run powerd to lower our power usage.
powerd_flags="" # Flags to powerd (if enabled).
+sensorsd_enable="NO" # Run sensorsd to monitor and log sensor state changes
+sensorsd_flags="" # additional flags for sensorsd(8)
tmpmfs="AUTO" # Set to YES to always create an mfs /tmp, NO to never
tmpsize="20m" # Size of mfs /tmp if created
tmpmfs_flags="-S" # Extra mdmfs options for the mfs /tmp
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index 56aa598..5f58a6f 100755
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -33,7 +33,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
random rarpd resolv root \
route6d routed routing rpcbind rtadvd rwho \
savecore sdpd securelevel sendmail \
- serial sppp statd swap1 \
+ sensorsd serial sppp statd swap1 \
syscons sysctl syslogd \
timed tmp \
ugidfw \
diff --git a/etc/rc.d/sensorsd b/etc/rc.d/sensorsd
new file mode 100644
index 0000000..51bd970
--- /dev/null
+++ b/etc/rc.d/sensorsd
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: sensorsd
+# REQUIRE: syslogd
+#
+
+. /etc/rc.subr
+
+name="sensorsd"
+rcvar=`set_rcvar`
+command="/usr/sbin/${name}"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/etc/sensorsd.conf b/etc/sensorsd.conf
new file mode 100644
index 0000000..3b41b28
--- /dev/null
+++ b/etc/sensorsd.conf
@@ -0,0 +1,50 @@
+# $FreeBSD$
+# $OpenBSD: sensorsd.conf,v 1.8 2007/08/14 19:02:02 cnst Exp $
+
+#
+# Sample sensorsd.conf file. See sensorsd.conf(5) for details.
+#
+
+# +5 voltage (volts)
+#hw.sensors.lm0.volt3:low=4.8V:high=5.2V
+
+# +12 voltage (volts)
+#hw.sensors.lm0.volt4:low=11.5V:high=12.5V
+
+# Chipset temperature (degrees Celsius)
+#hw.sensors.lm0.temp0:high=50C
+
+# CPU temperature (degrees Celsius)
+#hw.sensors.lm0.temp1:high=60C
+
+# CPU fan (RPM)
+#hw.sensors.lm0.fan1:low=3000
+
+# ignore certain indicators on ipmi(4)
+#hw.sensors.ipmi0.indicator1:istatus
+
+# Warn if any temperature sensor is over 70 degC.
+# This entry will match only those temperature sensors
+# that don't have their own entry.
+#temp:high=70C
+
+
+# By default, sensorsd(8) reports status changes of all sensors that
+# keep their state. Uncomment the following lines if you want to
+# suppress reports about status changes of specific sensor types.
+
+#temp:istatus
+#fan:istatus
+#volt:istatus
+#acvolt:istatus
+#resistance:istatus
+#power:istatus
+#current:istatus
+#watthour:istatus
+#amphour:istatus
+#indicator:istatus
+#raw:istatus
+#percentage:istatus
+#illuminance:istatus
+#drive:istatus
+#timedelta:istatus
OpenPOWER on IntegriCloud