Smartmontools

From CBLFS
Revision as of 02:08, 6 September 2009 by Oppiz (talk | contribs) (Undo revision 18895 by Weibullguy (Talk) What if I want a 32bit binary? Alot of work has gone into getting 32bit build. no need to remove)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Download Source: http://downloads.sourceforge.net/smartmontools/smartmontools-5.41.tar.gz

Introduction to Smartmontools

The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks. In many cases, these utilities will provide advanced warning of disk degradation and failure.

Project Homepage: http://smartmontools.sourceforge.net/

Dependencies

Non-Multilib

Compile the package:

sed -i '/$(initddir)\/smartd/d' Makefile.in
./configure --prefix=/usr --sysconfdir=/etc \
    --with-initscriptdir=/etc/rc.d/init.d &&
make

Install the package:

make install

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

Compile the package:

sed -i '/$(initddir)\/smartd/d' Makefile.in
CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
./configure --prefix=/usr --sysconfdir=/etc \
    --with-initscriptdir=/etc/rc.d/init.d &&
make

Install the package:

make install

N32

Compile the package:

sed -i '/$(initddir)\/smartd/d' Makefile.in
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
./configure --prefix=/usr --sysconfdir=/etc \
    --with-initscriptdir=/etc/rc.d/init.d &&
make

Install the package:

make install

64Bit

Compile the package:

sed -i '/$(initddir)\/smartd/d' Makefile.in
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \
./configure --prefix=/usr --sysconfdir=/etc \
    --with-initscriptdir=/etc/rc.d/init.d &&
make

Install the package:

make install

Configuring

Create the smartd-bootscript

cat > /etc/rc.d/init.d/smartd << "EOF"
#!/bin/sh
##########################################################################
# Begin $rc_base/init.d/smartd
#
# Description : 
#
# Authors     :  Jens Ornot (oj_webstar@yahoo[dot]de)
#
# Version     : 00.01
#
# Notes       :
#
###########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
        start)
                boot_mesg "Starting SmartMon Daemon..."
                loadproc /usr/sbin/smartd
                ;;

        stop)
                boot_mesg "Stopping SmartMon Daemon..."
                killproc /usr/sbin/smartd
                ;;

        restart)
                ${0} stop
                sleep 1
                ${0} start
                ;;

        status)
                statusproc /usr/sbin/smartd
                ;;

        *)
                echo "Usage: ${0} {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/smartd
EOF
chmod -v 754 /etc/rc.d/init.d/smartd

Link it into the run-levels:

for link in /etc/rc.d/rc{{0,1,6}.d/K20,{2,3,4,5}.d/S55}smartd; do
  ln -sfv ../init.d/smartd ${link};
done

Contents

Installed Programs: smartd smartctl
Installed Libraries: None
Installed Directories: /usr/share/doc/smartmontools-5.41