aboutsummaryrefslogtreecommitdiff
path: root/system/hddtemp
diff options
context:
space:
mode:
Diffstat (limited to 'system/hddtemp')
-rw-r--r--system/hddtemp/README20
-rw-r--r--system/hddtemp/README.Slackware27
-rw-r--r--system/hddtemp/doinst.sh1
-rw-r--r--system/hddtemp/hddtemp.SlackBuild39
-rw-r--r--system/hddtemp/hddtemp.info2
-rw-r--r--system/hddtemp/rc.hddtemp.new102
-rw-r--r--system/hddtemp/slack-desc10
7 files changed, 168 insertions, 33 deletions
diff --git a/system/hddtemp/README b/system/hddtemp/README
index 7f3abd48b807..76b38fc83b70 100644
--- a/system/hddtemp/README
+++ b/system/hddtemp/README
@@ -1,21 +1,5 @@
-hddtemp (reads hard disk S.M.A.R.T. info and reports temperature)
-
hddtemp is a small and daemonizable utility designed to read the
S.M.A.R.T. information from the given hard disk and report the
-temperature of the disk. Different hard disk manufacturers use
-different raw values in their S.M.A.R.T. data and the hddtemp.db file
-helps to map raw values to actual temperatures.
-
-http://www.guzu.net/linux/hddtemp.php
-https://savannah.nongnu.org/projects/hddtemp/
-
-The hddtemp.db file does not include more recent hard disks as the
-project does not appear to be maintained anymore. To resolve this,
-simply add your disk to the file manually. Run hddtemp on your drive
-to get the expected string and use the other entries in the file as
-templates to create a new one.
+temperature of the disk.
-Note that only a few hard disks actually differ from the 194C value so
-you can bet your disk will probably use that value too, but I
-recommend using older drives from the same manufacturer that are in the
-file as a guideline.
+Note: hddtemp does not support eMMC or NVMe devices.
diff --git a/system/hddtemp/README.Slackware b/system/hddtemp/README.Slackware
new file mode 100644
index 000000000000..7a68e8d36fa0
--- /dev/null
+++ b/system/hddtemp/README.Slackware
@@ -0,0 +1,27 @@
+To use hddtemp you need to do the following:
+
+First you must make sure hddtemp knows how to handle your disks. Run
+the command "hddtemp /dev/sdX" as root for each of your block devices.
+If it correctly reports HDD model and its temperature, you're all set.
+If instead you get a warning that the drive is not in the database, you
+have to add a record describing your device to /etc/hddtemp/hddtemp.db.
+Use the disk ID string returned by hddtemp in the first column. Most
+drives will use "194" and "C" in second and third columns, but check
+output of "smartctl" command to see if this is really the case for your
+disk. The last column is a free-form description of the device.
+
+Next, edit /etc/rc.d/rc.hddtemp and set HDDTEMP_DRIVES variable to a list
+of drives you want to monitor. Use the usual /dev/sdX block device files,
+or the symlinks available in /dev/disk/. Multiple entries must be separated
+with spaces. The remaining configuration variables are set to reasonable
+defaults, change them if it suits your needs.
+
+Finally, to start hddtemp automatically at boot, make /etc/rc.d/rc.hddtemp
+executable and add the following to your /etc/rc.d/rc.local:
+
+if [ -x /etc/rc.d/rc.hddtemp ]; then
+ . /etc/rc.d/rc.hddtemp start
+fi
+
+Once the hddtemp daemon is running you can use hddtemp-aware tools such as
+gkrellm or Conky to display the temperature readings.
diff --git a/system/hddtemp/doinst.sh b/system/hddtemp/doinst.sh
index 7f616013b760..822ea598b25b 100644
--- a/system/hddtemp/doinst.sh
+++ b/system/hddtemp/doinst.sh
@@ -12,4 +12,5 @@ config() {
}
config etc/hddtemp/hddtemp.db.new
+config etc/rc.d/rc.hddtemp.new
diff --git a/system/hddtemp/hddtemp.SlackBuild b/system/hddtemp/hddtemp.SlackBuild
index 4573308d9c01..bb6a139ca36f 100644
--- a/system/hddtemp/hddtemp.SlackBuild
+++ b/system/hddtemp/hddtemp.SlackBuild
@@ -2,13 +2,31 @@
# Slackware build script for hddtemp
-# Written by Zordrak
-
-# Modified by SlackBuilds.org
+# Copyright 2010 Zordrak
+# Copyright 2010-2020 SlackBuilds.org
+# Copyright 2020 Dominik Drobek <dominik.drobek (at) o2.pl>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=hddtemp
VERSION=${VERSION:-0.3beta15}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
SRCVERSION="0.3-beta15"
@@ -61,24 +79,27 @@ CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
- --libdir=/usr/lib$LIBDIRSUFFIX \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
--with-db-path=/etc/hddtemp/hddtemp.db \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
+install -D -m 644 $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new
+install -D -m 644 $CWD/rc.hddtemp.new $PKG/etc/rc.d/rc.hddtemp.new
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-mkdir -p $PKG/etc/hddtemp
-cp $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new
-
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ABOUT-NLS ChangeLog GPL-2 INSTALL README TODO COPYING LICENSE contribs \
+cp -a ABOUT-NLS ChangeLog GPL-2 INSTALL README TODO COPYING LICENSE contribs/ \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
diff --git a/system/hddtemp/hddtemp.info b/system/hddtemp/hddtemp.info
index 9d28ae58c713..3bdfd6cf6ee5 100644
--- a/system/hddtemp/hddtemp.info
+++ b/system/hddtemp/hddtemp.info
@@ -1,7 +1,7 @@
PRGNAM="hddtemp"
VERSION="0.3beta15"
HOMEPAGE="https://savannah.nongnu.org/projects/hddtemp/"
-DOWNLOAD="http://download.savannah.gnu.org/releases/hddtemp/hddtemp-0.3-beta15.tar.bz2"
+DOWNLOAD="https://download.savannah.gnu.org/releases/hddtemp/hddtemp-0.3-beta15.tar.bz2"
MD5SUM="8b829339e1ae9df701684ec239021bb8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
diff --git a/system/hddtemp/rc.hddtemp.new b/system/hddtemp/rc.hddtemp.new
new file mode 100644
index 000000000000..6532a95cde9f
--- /dev/null
+++ b/system/hddtemp/rc.hddtemp.new
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+# Script to start/stop/restart the hddtemp daemon.
+# Copyright 2017, 2020 Dominik Drobek <dominik.drobek (at) o2.pl>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+# Configuration options for hddtemp:
+
+# HDDTEMP_DRIVES must contain a list of drives to monitor.
+# The daemon will not start without it.
+HDDTEMP_DRIVES=""
+
+# Listen host and port:
+HDDTEMP_LISTENHOST="--listen=localhost"
+HDDTEMP_PORT="--port=7634"
+
+# Additional options (man 8 hddtemp):
+#HDDTEMP_OPTIONS=""
+
+hddtemp_getpid() {
+ HDDTEMP_PID="$(pidof hddtemp 2> /dev/null)"
+}
+
+hddtemp_start() {
+ hddtemp_getpid
+ if [ -n "${HDDTEMP_PID}" ]; then
+ echo "hddtemp daemon is already running!"
+ exit
+ fi
+
+ if [ -x /usr/sbin/hddtemp ]; then
+ echo -n "Starting hddtemp daemon: "
+ /usr/sbin/hddtemp --daemon \
+ ${HDDTEMP_LISTENHOST} \
+ ${HDDTEMP_PORT} \
+ ${HDDTEMP_OPTIONS} \
+ ${HDDTEMP_DRIVES} &> /dev/null
+ fi
+
+ hddtemp_getpid
+ if [ -n "${HDDTEMP_PID}" ]; then
+ echo "success"
+ else
+ echo "failed!"
+ fi
+}
+
+hddtemp_stop() {
+ hddtemp_getpid
+ if [ -z "${HDDTEMP_PID}" ]; then
+ echo "hddtemp daemon is not running!"
+ exit
+ else
+ echo -n "Stopping hddtemp daemon: "
+ kill "${HDDTEMP_PID}" &> /dev/null
+ sleep 1
+ fi
+
+ hddtemp_getpid
+ if [ -z "${HDDTEMP_PID}" ]; then
+ echo "success"
+ else
+ echo "failed!"
+ fi
+}
+
+hddtemp_restart() {
+ hddtemp_stop
+ hddtemp_start
+}
+
+case "$1" in
+ "start")
+ hddtemp_start
+ ;;
+ "stop")
+ hddtemp_stop
+ ;;
+ "restart")
+ hddtemp_restart
+ ;;
+ *)
+ echo "usage: $0 start|stop|restart"
+esac
diff --git a/system/hddtemp/slack-desc b/system/hddtemp/slack-desc
index 64d06f1ae360..b2eba9720442 100644
--- a/system/hddtemp/slack-desc
+++ b/system/hddtemp/slack-desc
@@ -10,10 +10,10 @@ hddtemp: hddtemp (reads hard disk S.M.A.R.T. info and reports temperature)
hddtemp:
hddtemp: hddtemp is a small and daemonizable utility designed to read the
hddtemp: S.M.A.R.T. information from the given hard disk and report the
-hddtemp: temperature of the disk. Different hard disk manufacturers use
-hddtemp: different raw values in their S.M.A.R.T. data and the hddtemp.db file
-hddtemp: helps to map raw values to actual temperatures.
+hddtemp: temperature of the disk.
+hddtemp:
+hddtemp: Homepage: https://savannah.nongnu.org/projects/hddtemp/
+hddtemp:
+hddtemp:
hddtemp:
-hddtemp: http://www.guzu.net/linux/hddtemp.php
-hddtemp: https://savannah.nongnu.org/projects/hddtemp/
hddtemp: