From 938a627d3e4fd5da4c44411d6509d476d9b3494f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 19 Dec 2007 22:39:50 +0000 Subject: [PATCH] More system integration improvements: * Call insserv on the lm_sensors service when present. * No sleep before running sensors -s. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5085 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index f9529551..02c5bacb 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -5924,16 +5924,20 @@ EOT "for initialization at boot time.\n" unless -f "/etc/init.d/lm_sensors"; - print "You should now start the lm_sensors service to load the required\n". - "kernel modules.\n\n"; + if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { + system("/sbin/insserv", "/etc/init.d/lm_sensors"); + } else { + print "You should now start the lm_sensors service to load the required\n". + "kernel modules.\n\n"; + } } else { - print "To load everything that is needed, add this to e.g. /etc/rc.d/rc.local:\n\n"; + print "To load everything that is needed, add this to one of the system\n". + "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; print "#----cut here----\n". $modprobes. - "# sleep 2 # optional\n". (-e '/usr/bin/sensors' ? - "/usr/bin/sensors -s # recommended\n" : - "/usr/local/bin/sensors -s # recommended\n") . + "/usr/bin/sensors -s\n" : + "/usr/local/bin/sensors -s\n") . "#----cut here----\n\n"; print "If you have some drivers built into your kernel, the list above will\n".