Smartmontools installation instructions
=======================================

$Id: INSTALL,v 1.19 2003/10/05 13:57:18 ballen4705 Exp $

Please also see the smartmontools home page:
http://smartmontools.sourceforge.net/

Table of contents:

[1] Kernel requirements
[2] Installing from CVS
[3] Installing from source tarball
[4] Guidelines for different linux distributions
[5] Comments
[6] Detailed description of ./configure options

[1] Kernel requirements
=======================
Any recent Linux distribution should support smartmontools.  Note that
smartmontools requires Linux kernel 2.2.14 or greater in order to run
at all.  But to give the ATA RETURN SMART STATUS command, the kernel
needs to support the HDIO_DRIVE_TASK ioctl().  Any 2.4 series kernel
should provide this support.  Some of the 2.2.20 and later kernels
also provide this support if they're properly patched and configured.
Please see FAQ section of the URL above.


[2] Installing from CVS
=======================
Get the sources from the CVS archive:
cvs -d :pserver:anonymous@cvs.smartmontools.sourceforge.net:/cvsroot/smartmontools login
cvs -d :pserver:anonymous@cvs.smartmontools.sourceforge.net:/cvsroot/smartmontools co sm5
(when prompted for a password, just press Enter)

Then type:
./autogen.sh
and continue with step [3] below, skipping the "unpack the tarball" step.


Further details of using CVS can be found at the URL above.

The autogen.sh command is ONLY required when installing from CVS. You
need GNU Autoconf, GNU Automake, and their dependencies installed in
order to run it.


[3] Installing from the source tarball
======================================
If you are NOT installing from CVS, then unpack the tarball:
tar zxvf smartmontools-5.VERSION.tar.gz

Then:
./configure
make
make install (you may need to be root to do this)

As shown (with no options to ./configure) this defaults to the
following set of installation directories:
--prefix             = /usr
--sbindir            = /usr/sbin
--sysconfdir         = /etc
--mandir             = /usr/share/man
--with-docdir        = /usr/share/doc/smartmontools-VERSION
--with-initscriptdir = /etc/rc.d/init.d
These will overwrite existing "distribution" installations for Red
Hat, Slackware, and some other Linux distributions.

For different installation locations or distributions, simply change
add arguments to ./configure as shown in [4] below.

[4] Guidelines for different Linux distributions
================================================

Note: Please send corrections/additions to:
smartmontools-support@lists.sourceforge.net

Red Hat
 ./configure
 OR EQUIVALENTLY
 ./configure --sbindir=/usr/sbin                               \
             --sysconfdir=/etc                                 \
             --mandir=/usr/share/man                           \
             --with-initscriptdir=/etc/rc.d/init.d             \
             --with-docdir=/usr/share/doc/smartmontools-VERSION

Filesystem Hierarchy Standard (FHS), FreeBSD
  ./configure --sbindir=/usr/local/sbin                               \
              --sysconfdir=/usr/local/etc                             \
              --mandir=/usr/local/man                                 \
              --with-initscriptdir=/usr/local/etc/rc.d/init.d         \
              --with-docdir=/usr/local/share/doc/smartmontools-VERSION

SuSE
  ./configure [PLEASE ADD]

Debian
 ./configure --prefix=/usr/local

Slackware
If you don't want to overwrite any "distribution" package, use
 ./configure --prefix=/usr/local

Otherwise use
 ./configure --sbindir=/usr/sbin                               \
             --sysconfdir=/etc                                 \
             --mandir=/usr/share/man                           \
             --with-initscriptdir=/etc/rc.d                    \
             --with-docdir=/usr/share/doc/smartmontools-VERSION

And
 removepkg smartmontools smartsuite (only root can do this)
before make install

The init script works on Slackware. You just have to add an entry like
the following in /etc/rc.d/rc.M or /etc/rc.d/rc.local:

if [ -x /etc/rc.d/smartd ]; then
  . /etc/rc.d/smartd start
fi

To disable it:
chmod 644 /etc/rc.d/smartd

For a list of options:
/etc/rc.d/smartd

[5] Comments
============

To compile from another directory, you can replace the step
  ./configure [options]
by the following:
  mkdir objdir
  cd objdir
  ../configure [options]

To install to another destination (used mainly by package maintainers,
or to examine the package contents without risk of modifying any
system files) you can replace the step:
  make install
with:
  make DESTDIR=/home/myself/smartmontools-package install

Use a full path. Paths like ~/smartmontools-package may not work.

After installing smartmontools, you can read the man pages, and try
out the commands:
   
man smartd.conf
man smartctl
man smartd

/usr/sbin/smartctl -s on -o on -S on /dev/hda (only root can do this)
/usr/sbin/smartctl -a /dev/hda (only root can do this)

Note that the default location for the manual pages are
/usr/share/man/man5 and /usr/share/man/man8.  If "man" doesn't find
them, you may need to add /usr/share/man to your MANPATH environment
variable.

Source and binary RPM packages are available at
http://sourceforge.net/project/showfiles.php?group_id=64297

Refer to http://smartmontools.sourceforge.net/index.html#howtodownload
for any additional download and installation instructions.

The following files are installed:
/usr/sbin/smartctl				[Executable command-line utility]
/usr/sbin/smartd				[Executable daemon]
/etc/rc.d/init.d/smartd				[Init/Startup script for smartd]
/usr/share/man/man5/smartd.conf.5		[Manual page]
/usr/share/man/man8/smartctl.8			[Manual page]
/usr/share/man/man8/smartd.8			[Manual page]
/usr/share/doc/smartmontools-5.X/AUTHORS	[Information about the authors and developers]
/usr/share/doc/smartmontools-5.X/CHANGELOG	[A log of changes. Also see CVS]
/usr/share/doc/smartmontools-5.X/COPYING	[GNU General Public License Version 2]
/usr/share/doc/smartmontools-5.X/INSTALL	[Installation instructions: what you're reading!]
/usr/share/doc/smartmontools-5.X/NEWS		[Significant bugs discovered in old versions]
/usr/share/doc/smartmontools-5.X/README		[Overview]
/usr/share/doc/smartmontools-5.X/TODO		[Things that need to be done/fixed]
/usr/share/doc/smartmontools-5.X/WARNINGS	[Systems where lockups or other serious problems reported]
/usr/share/doc/smartmontools-5.X/smartd.conf	[Example configuration file for smartd]
/usr/share/doc/smartmontools-5.X/examplescripts	[Executable scripts for -M exec of smartd.conf (4 files)]


[6] Detailed description of arguments to configure command
==========================================================

When you type:
./configure [options]
there are six particularly important variables that affect where the
smartmontools software is installed.  The variables are listed here,
with their default values in square brackets, and the quantities that
they affect described following that.  This is a very wide table: please read
it in a wide window.

OPTIONS              DEFAULT                                      AFFECTS
-------              -------                                      -------
--prefix             [NO VALUE]                                   Please see below
--sbindir            /usr/sbin                                    Directory for smartd/smartctl executables;
                                                                  Contents of smartd/smartctl man pages
--mandir             /usr/share/man                               Directory for smartctl/smartd/smartd.conf man pages
--sysconfdir         /etc                                         Directory for smartd.conf;
                                                                  Contents of smartd executable;
                                                                  Contents of smartd/smartd.conf man pages;
                                                                  Directory for rc.d/init.d/smartd init script
--with-initscriptdir  ${sysconfdir}/init.d/rc.d                   Location of init scripts       
--with-docdir	      $(prefix)/usr/share/doc/smartmontools-5.X   Location of the documentation


If you set --prefix and NONE of the other four variables, for example:
./configure --prefix=/home/joe
then the DEFAULT paths will ALL have prefix appended to them.

For example, if you set --prefix=/home/joe and none of the other four
variables then the different directories that are used would be:
--sbindir             /home/joe/usr/sbin
--mandir              /home/joe/usr/share/man
--sysconfdir          /home/joe/etc
--with-initscriptdir  /home/joe/etc/init.d/rc.d
--with-docdir	      /home/joe/usr/share/doc/smartmontools-5.X

This is useful for test installs in a harmless subdirectory somewhere.

Here are the four possible cases for the four variables above:

Case 1:
--prefix not set
--variable not set
===> VARIABLE gets default value above

Case 2:
--prefix set
--variable not set
===> VARIABLE gets PREFIX/ prepended to default value above

Case 3:
--prefix not set
--variable set
===> VARIABLE gets value that is set

Case 4:
--prefix is set
--variable is set
===> PREFIX is IGNORED, VARIABLE gets value that is set


For Filesystem Hierarchy Standard (FHS) installation locations
described in http://www.pathname.com/fhs/ please use:
--prefix=/usr/local


Additional information about using configure can be found here:
http://www.gnu.org/manual/autoconf-2.57/html_mono/autoconf.html#SEC139
