diff --git a/sm5/smartctl.8 b/sm5/smartctl.8 index c75272f999989505f879d786db90c1423dd4f0e6..6df5f226a16d6d2d4c3aeedae3c5025c14922a3c 100644 --- a/sm5/smartctl.8 +++ b/sm5/smartctl.8 @@ -1,6 +1,6 @@ \# Copyright (C) 2002 Bruce Allen <ballen@uwm.edu> \# -\# $Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $ +\# $Id: smartctl.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $ \# \# 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 @@ -10,7 +10,7 @@ \# You should have received a copy of the GNU General Public License (for \# example COPYING); if not, write to the Free Software Foundation, Inc., 675 \# Mass Ave, Cambridge, MA 02139, USA. -.TH SMARTCTL 8 "$Date: 2002/10/10 13:21:15 $" "smartmontools-5.0" +.TH SMARTCTL 8 "$Date: 2002/10/11 03:46:17 $" "smartmontools-5.0" .SH NAME smartctl \- S.M.A.R.T. control utility .SH SYNOPSIS @@ -57,7 +57,7 @@ p. .B Read-only options: .TP p -Print: Prints Copyright and License information. +Print: Prints version, copyright and license information. .TP i Information: Check if the device supports S.M.A.R.T. Prints the @@ -296,4 +296,4 @@ Please let us know if there is an on\-line source for this document. .SH CVS ID OF THIS PAGE: -$Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $ +$Id: smartctl.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $ diff --git a/sm5/smartctl.c b/sm5/smartctl.c index c281cc49b77892f0eae5356638c54d99b51a43a4..d1d3f60a971709423803f545b6fdcf1ca4796bea 100644 --- a/sm5/smartctl.c +++ b/sm5/smartctl.c @@ -1,4 +1,4 @@ -// $Id: smartctl.c,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $ +// $Id: smartctl.c,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $ /* * smartctl.c * @@ -113,25 +113,23 @@ void Usage ( void){ } +const char opts[] = { + DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB, + GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE, + SMARTENABLE, SMARTAUTOOFFLINEENABLE, SMARTAUTOOFFLINEDISABLE, + SMARTEXEOFFIMMEDIATE, SMARTSHORTSELFTEST, SMARTEXTENDSELFTEST, + SMARTSHORTCAPSELFTEST, SMARTEXTENDCAPSELFTEST, SMARTSELFTESTABORT, + SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0' +}; -/* void ParseOpts ( chars *opts) - Takes command options and sets features to be run */ - +/* Takes command options and sets features to be run */ void ParseOpts (int argc, char** argv){ - int optchar; - extern char *optarg; - extern int optopt, optind; - const char opts[] = { - DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB, - GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE, - SMARTENABLE, SMARTAUTOOFFLINEENABLE, SMARTAUTOOFFLINEDISABLE, - SMARTEXEOFFIMMEDIATE, SMARTSHORTSELFTEST, SMARTEXTENDSELFTEST, - SMARTSHORTCAPSELFTEST, SMARTEXTENDCAPSELFTEST, SMARTSELFTESTABORT, - SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0' - }; - + int optchar; + extern char *optarg; + extern int optopt, optind, opterr; - while(EOF != (optchar = getopt(argc, argv, opts))) { + opterr=1; + while (-1 != (optchar = getopt(argc, argv, opts))) { switch (optchar){ case PRINTCOPYLEFT : printcopyleft=TRUE; @@ -231,7 +229,7 @@ int main (int argc, char **argv){ printf("is free software, and you are welcome to redistribute it\n"); printf("under the terms of the GNU General Public License Version 2.\n"); printf("See http://www.gnu.org for further details.\n\n"); - printf("CVS version ID %s\n","$Id: smartctl.c,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $"); + printf("CVS version ID %s\n","$Id: smartctl.c,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $"); exit(0); } diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp index 1a3a4df7e267c6c1feef0c7e803bc87501ae158b..fc9334c477a4064af05b5572846a5d8f365eb6d3 100644 --- a/sm5/smartctl.cpp +++ b/sm5/smartctl.cpp @@ -1,4 +1,4 @@ -// $Id: smartctl.cpp,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $ +// $Id: smartctl.cpp,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $ /* * smartctl.c * @@ -113,25 +113,23 @@ void Usage ( void){ } +const char opts[] = { + DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB, + GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE, + SMARTENABLE, SMARTAUTOOFFLINEENABLE, SMARTAUTOOFFLINEDISABLE, + SMARTEXEOFFIMMEDIATE, SMARTSHORTSELFTEST, SMARTEXTENDSELFTEST, + SMARTSHORTCAPSELFTEST, SMARTEXTENDCAPSELFTEST, SMARTSELFTESTABORT, + SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0' +}; -/* void ParseOpts ( chars *opts) - Takes command options and sets features to be run */ - +/* Takes command options and sets features to be run */ void ParseOpts (int argc, char** argv){ - int optchar; - extern char *optarg; - extern int optopt, optind; - const char opts[] = { - DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB, - GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE, - SMARTENABLE, SMARTAUTOOFFLINEENABLE, SMARTAUTOOFFLINEDISABLE, - SMARTEXEOFFIMMEDIATE, SMARTSHORTSELFTEST, SMARTEXTENDSELFTEST, - SMARTSHORTCAPSELFTEST, SMARTEXTENDCAPSELFTEST, SMARTSELFTESTABORT, - SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0' - }; - + int optchar; + extern char *optarg; + extern int optopt, optind, opterr; - while(EOF != (optchar = getopt(argc, argv, opts))) { + opterr=1; + while (-1 != (optchar = getopt(argc, argv, opts))) { switch (optchar){ case PRINTCOPYLEFT : printcopyleft=TRUE; @@ -231,7 +229,7 @@ int main (int argc, char **argv){ printf("is free software, and you are welcome to redistribute it\n"); printf("under the terms of the GNU General Public License Version 2.\n"); printf("See http://www.gnu.org for further details.\n\n"); - printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $"); + printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $"); exit(0); } diff --git a/sm5/smartd.8 b/sm5/smartd.8 index 5a16877f89ad1a6c7780823ec91fb450ac444631..d00d2883e2d01283a159c658de533ba3d47052cc 100644 --- a/sm5/smartd.8 +++ b/sm5/smartd.8 @@ -8,7 +8,7 @@ \# You should have received a copy of the GNU General Public License (for \# example COPYING); if not, write to the Free Software Foundation, Inc., 675 \# Mass Ave, Cambridge, MA 02139, USA. -.TH SMARTD 8 "$Date: 2002/10/10 13:21:17 $" "smartmontools-5.0" +.TH SMARTD 8 "$Date: 2002/10/11 03:46:17 $" "smartmontools-5.0" .SH NAME smartd \- S.M.A.R.T. Daemon .SH SYNOPSIS @@ -26,7 +26,7 @@ smartd is compatible with ATA/ATAPI-5 and earlier standards (see REFERENCES below) .B smartd -is daemon designed to notify users of S.M.A.R.T. errors and changes of +will notify users of S.M.A.R.T. errors and changes of S.M.A.R.T. attributes via the SYSLOG interface. These notifications and warnings normally appear in /var/log/messages. @@ -45,12 +45,18 @@ smartd daemon scans for all devices that support S.M.A.R.T., using "/dev/hd*" for IDE/ATA devices, and "/dev/sd*" for SCSI devices. It polls these devices every 30 minutes checking for S.M.A.R.T. errors. -.PP +[Note that on start-up, when +.B +smartd +scans for devices, a warning message may appear in +/var/log/messages, about missing block-major-xx devices. These +messages are harmless.] +.P .SH OPTIONS .TP p -Prints license and copyright information onto STDOUT and into the SYSLOG +Prints license, copyright, and version information onto STDOUT or into the SYSLOG log (normally /var/log/messages) and then exits. .TP X @@ -63,21 +69,35 @@ displays status information to STDOUT. .B smartd .fi -runs in forked (daemon) mode. This is the normal way to run +runs the daemon in forked mode. This is the normal way to run .B -smartd +smartd. .fi +.fi Note that smartmontools provides a start-up script in +.B /etc/rc.d/init.d/smartd +which is responsible for starting and stopping the daemon via the +normal init interface. +Using this script, you can start .B -/etc/rc.d/init.d/smartd -which is responsible for starting and stopping the daemon via the normal init interface. This can be enabled using the command: +smartd +by giving the command +.B '/etc/rc.d/init.d/smartd start' +and stop it by using +.B '/etc/rc.d/init.d/smartd stop'. + +If you want +.B +smartd +to start running whenever your machine is booted, this can be enabled by using the command: .nf -/sbin/chkconfig --add smartd +.B '/sbin/chkconfig --add smartd' .fi and disabled using the command: .nf -/sbin/chkconfig --del smartd +.B '/sbin/chkconfig --del smartd' + .PP .SH AUTHOR @@ -149,4 +169,4 @@ Please let us know if there is an on\-line source for this document. .SH CVS ID OF THIS PAGE: -$Id: smartd.8,v 1.4 2002/10/10 13:21:17 ballen4705 Exp $ +$Id: smartd.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $ diff --git a/sm5/smartd.c b/sm5/smartd.c index af8ca74ff1aaaa117f211c455d32b0b33f272ae1..3ee6a2f65887628d662e4a627abf395d3be94823 100644 --- a/sm5/smartd.c +++ b/sm5/smartd.c @@ -1,4 +1,4 @@ -// $Id: smartd.c,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $ +// $Id: smartd.c,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $ /* * smartd.c * @@ -264,8 +264,9 @@ char copyleftstring[]= "is free software, and you are welcome to redistribute it\n" "under the terms of the GNU General Public License Version 2.\n" "See http://www.gnu.org for further details.\n\n" -"CVS Version ID $Id: smartd.c,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $\n"; +"CVS Version ID $Id: smartd.c,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $\n"; +const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' }; /* Main Program */ int main (int argc, char **argv){ @@ -274,15 +275,15 @@ int main (int argc, char **argv){ scsidevices_t scsidevices[MAXSCSIDEVICES], *scsidevicesptr; int optchar; extern char *optarg; - extern int optopt, optind; - const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' }; - + extern int optopt, optind, opterr; + numatadevices=0; numscsidevices=0; scsidevicesptr = scsidevices; atadevicesptr = atadevices; + opterr=1; - while(EOF != (optchar = getopt(argc, argv, opts))){ + while (-1 != (optchar = getopt(argc, argv, opts))){ switch(optchar) { case PRINTCOPYLEFT: printcopyleft=TRUE; diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index f1255ac57b8d279d750a2ebdb45d493f40b7079f..68ab0d50c14b7ee8720fa79943f0944d9f16fd2f 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -1,4 +1,4 @@ -// $Id: smartd.cpp,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $ +// $Id: smartd.cpp,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $ /* * smartd.c * @@ -264,8 +264,9 @@ char copyleftstring[]= "is free software, and you are welcome to redistribute it\n" "under the terms of the GNU General Public License Version 2.\n" "See http://www.gnu.org for further details.\n\n" -"CVS Version ID $Id: smartd.cpp,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $\n"; +"CVS Version ID $Id: smartd.cpp,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $\n"; +const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' }; /* Main Program */ int main (int argc, char **argv){ @@ -274,15 +275,15 @@ int main (int argc, char **argv){ scsidevices_t scsidevices[MAXSCSIDEVICES], *scsidevicesptr; int optchar; extern char *optarg; - extern int optopt, optind; - const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' }; - + extern int optopt, optind, opterr; + numatadevices=0; numscsidevices=0; scsidevicesptr = scsidevices; atadevicesptr = atadevices; + opterr=1; - while(EOF != (optchar = getopt(argc, argv, opts))){ + while (-1 != (optchar = getopt(argc, argv, opts))){ switch(optchar) { case PRINTCOPYLEFT: printcopyleft=TRUE;