From 1cf9ea0c54688d3e2af3265b9c04b5388ce1615b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 19 Dec 2007 22:36:13 +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/branches/lm-sensors-3.0.0@5084 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 f51d9c08..8aac8416 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".