RH 7.3 /etc/rc.d/init.d/sensors
I've integrated 'sensors' into my RH 7.3 startups in /etc/rc.d/init.d.
I'm attaching my current sensors script and the related /etc/sysconfig/sensors.
I've got a Asus K7M (Athlon/650) motherboard.
sensors-detect picks up a w83782d (loads the w83781d driver and a via686a. However, the via doesn't ever display anything.
It's also picking up my monitor with the DDCMON driver (which is kind of neat) because I have a Matrox G400-TV video card.
Also, lots of your links are broken (link rot) or they do not point to the "real" www2 server URL.
Mike808/
Signature · 49 lines
() Join the ASCII ribbon campaign against HTML email and Microsoft-specific /\ attachments. If I wanted to read HTML, I would have visited your website! Support open standards. -------------- next part -------------- # This is /etc/sysconfig/sensors. # # sensors is used for monitoring motherboard sensor values. # # See also the lm_sensors homepage at: # http://www2.lm-sensors.nu/~lm78/index.html # # This file is used by /etc/rc.d/init.d/sensors and defines the modules to be # loaded/unloaded. This file is sourced into /etc/rc.d/init.d/sensors. # The format of this file is a shell script that simply defines the modules # in order as normal variables with the special names: # MODULE_1, MODULE_2, MODULE_3, etc. # # List the modules that are to be loaded for your system # Adapted from results of running /usr/sbin/sensors-detect # # Mine said (I have an ASUS K7M motherboard): # # #----cut here---- # # I2C adapter drivers # modprobe i2c-matroxfb # # modprobe unknown adapter MAVEN:fb0 on i2c-matroxfb using Bit-shift algorithm # # modprobe unknown adapter MAVEN:fb0 on i2c-matroxfb using Bit-shift algorithm # modprobe i2c-isa # # I2C chip drivers # modprobe ddcmon # modprobe w83781d # modprobe via686a # #----cut here---- # # Here is my module list MODULE_1=i2c-matroxfb MODULE_2=i2c-isa MODULE_3Ýcmon MODULE_4=w83781d MODULE_5=via686a -------------- next part -------------- A non-text attachment was scrubbed... Name: sensors Type: application/x-shellscript Size: 2243 bytes Desc: not available Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20020622/8477effc/sensors.bin
I think that's a great idea to make things easier for redhat people. You called them both sensors, I guess the second one is really sensors.init?
I'm not a Redhat expert, perhaps you could write a short "README" for us giving a brief description of what these do, and how to install and configure them?
Where should we put them - prog/init? We already have something called sensors there, though, and you're sending 2 more - help :)
Also please verify they're GPL.
thanks
mds
Quoted 30 lines · mike808 wrote:
I've integrated 'sensors' into my RH 7.3 startups in
/etc/rc.d/init.d.I'm attaching my current sensors script and the related
/etc/sysconfig/sensors.I've got a Asus K7M (Athlon/650) motherboard.
sensors-detect picks up a w83782d (loads the w83781d driver and a via686a. However, the via doesn't ever display anything.It's also picking up my monitor with the DDCMON driver (which is kind of neat) because I have a Matrox G400-TV video card.
Also, lots of your links are broken (link rot) or they do not point to the "real" www2 server URL.
Mike808/
--
() Join the ASCII ribbon campaign against HTML email and Microsoft-specific /\ attachments. If I wanted to read HTML, I would have visited your website! Support open standards.Name: sensors
sensors Type: Plain Text (text/plain)
Encoding: 7bitName: sensors
sensors Type: application/x-shellscript
Encoding: 7bit
Yes I read the tops of both files. I was hoping for something to use for a README so people could decide between the two scripts, without having to write it myself. Oh well.
I pasted what you gave me and made a README.
checked in.
thanks
Quoted 125 lines · mike808 wrote:
Quoted 3 lines · Mark D. Studebaker
I think that's a great idea to make things easier for redhat people. You called them both sensors, I guess the second one is really sensors.init?
The big fat script is
/etc/rc.d/init.d/sensorsThe small one with just the MODULE_# variable definitions goes into
/etc/sysconfig/sensors. The first line of the file is a comment that says exactly this. Did you read them?They're both called "sensors". It might be better to rename these "
lm_sensors" to better fit with the RPM/module naming.Quoted 3 lines
I'm not a Redhat expert, perhaps you could write a short "README" for us giving a brief description of what these do, and how to install and configure them?
The script
/etc/rc.d/init.d/sensorsis a nice startup/shutdown script.On RH and other RH-based systems (MDK, notably) use this sort of startup mechanism (i.e. SVR4-based), as opposed to the everything-in-one-script (
/etc/rcor/etc/rc.local) like the BSD-based systems do.Quoted 4 lines
Where should we put them - prog/init? We already have something called sensors there, though, and you're sending 2 more - help :)
Also please verify they're GPL.
Yup. They're your basic startup scripts. I "borrowed" the outline of the startup script from RH's apmd startup script. I'm not sure if the "condreload" function really makes any sense. And the "reload" function is just an alias for "restart", so I'm not sure it would be necessary either.
You should note that the
/etc/sysconfig/sensorsis only a list of modules - as would be determined by running sensors-detect. If you use these, you should change the instructions in sensors-detect for the cut-n-paste to reflect this.Please read the comments in the files if you are confused about which file is which, and where it belongs. They are there to be read, after all.
I'm not quite setup to ask for CVS write priviledges, and I'm only contributing these two files right now.
Here's a patch for sensors-detect to automagically write the
/etc/sysconfig/sensorsfor you. This is only useful on systems that use the SVR4 approach (i.e. RH, MDK, SuSE, etc.).# diff -c sensors-detect sensors-detect.orig *** sensors-detect Mon Jun 24 01:33:45 2002 --- sensors-detect.orig Mon Jun 24 01:00:22 2002 *************** *** 2587,2646 **** print $configfile; print "#----cut here----\n";(quoted diff) +0
-9- print "\nDo you want to generate /etc/sysconfig/sensors? (YES/no): "; - if ($> != 0) { - print "\nAs you are not root, we shall skip this step.\n"; - } else { - if (not <STDIN> =~ /^\s*[Nn]/) { - open(SYSCONFIG, ">/etc/sysconfig/sensors") - or die "Sorry, can't create /etc/sysconfig/sensors ($!)?!?"; - print SYSCONFIG <<'EOT'; - # /etc/sysconfig/sensors - Defines modules loaded by
/etc/rc.d/init.d/sensors
- # Copyright (c) 1998 - 2001 Frodo Looijaard <[email protected]>
- #- # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by - # the Free Software Foundation; either version 2 of the License, or - # (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software - # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- #
- # See also thelm_sensorshomepage at:
- # http://www2.lm-sensors.nu/~lm78/index.html
- #
- # This file is used by/etc/rc.d/init.d/sensorsand defines the modules to be
- # loaded/unloaded. This file is sourced into/etc/rc.d/init.d/sensors.
- #
- # The format of this file is a shell script that simply defines the modules
- # in order as normal variables with the special names:
- #MODULE_1,MODULE_2,MODULE_3, etc.
- #
- # List the modules that are to be loaded for your system
- #
- EOT(quoted diff) +0
-15- print SYSCONFIG - "# Generated by sensors-detect on " . scalar localtime . "\n"; - my @modules = grep /^modprobe /, split "\n", $modprobes; - my $i = 1; - my $sysconfig = ""; - foreach (@modules) { - s/^modprobe //; - $sysconfig .= "MODULE_$i=$_\n"; - $i++; - } - print SYSCONFIG $sysconfig; - close(SYSCONFIG); - } - } } main; --- 2587,2592 ----Mike808/
--
() Join the ASCII ribbon campaign against HTML email and Microsoft-specific /\ attachments. If I wanted to read HTML, I would have visited your website! Support open standards.