diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index a287c25b0621b001dfd4860e71f83599280efa6b..a04676d031f7feee743d8d0243f5e7111c5a5d0a 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.81 2003/01/04 10:28:35 ballen4705 Exp $ +$Id: CHANGELOG,v 1.82 2003/01/04 19:34:29 pjwilliams Exp $ Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> @@ -36,6 +36,8 @@ CURRENT RELEASE (see VERSION file in this directory): smartmontools-5.1.1 + [PW] Added -D, --showdirectives option to smartd + [DG] add '-l selftest' capability for SCSI devices (update smartctl.8) [BA] smartd,smartctl: added additional Attribute modification option diff --git a/sm5/README b/sm5/README index cf2ac1f5e1f4019b34df6b34b8cdaf2c054551f8..3322293354fe1763ec487679c2932483f8d5842a 100644 --- a/sm5/README +++ b/sm5/README @@ -249,5 +249,6 @@ Changes to smartd options: -V --version, --copyright, --license -V --version, --copyright, --license -X --debug -d --debug -i N --interval=N + -D --showdirectives ---------------------------------------------------------------------------------------------------------- diff --git a/sm5/smartd.8 b/sm5/smartd.8 index 3f3ef64fd7627098515534732672b90eb4280d83..9d6efc5a13a546a7b8a8ccc56afb50689f8431e0 100644 --- a/sm5/smartd.8 +++ b/sm5/smartd.8 @@ -1,6 +1,6 @@ \# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> \# -\# $Id: smartd.8,v 1.49 2003/01/04 13:45:41 ballen4705 Exp $ +\# $Id: smartd.8,v 1.50 2003/01/04 19:31:38 pjwilliams 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 @@ -16,7 +16,7 @@ \# Research Center), Jack Baskin School of Engineering, University of \# California, Santa Cruz. http://ssrc.soe.ucsc.edu/ \# -.TH SMARTD 8 "$Date: 2003/01/04 13:45:41 $" "smartmontools-5.1" +.TH SMARTD 8 "$Date: 2003/01/04 19:31:38 $" "smartmontools-5.1" .SH NAME smartd \- S.M.A.R.T. Daemon .SH SYNOPSIS @@ -105,6 +105,9 @@ in "debug" mode. In this mode, it does not (2) and displays status information to STDOUT. It also prints more verbose information about what it is doing. .TP +.B \-D, \-\-showdirectives +Prints the configuration file Directives to STDOUT and exits. +.TP .B \-i N, \-\-interval=N Sets the interval between disk checks to .I N @@ -684,4 +687,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.49 2003/01/04 13:45:41 ballen4705 Exp $ +$Id: smartd.8,v 1.50 2003/01/04 19:31:38 pjwilliams Exp $ diff --git a/sm5/smartd.c b/sm5/smartd.c index a8c7728b236b5aad43a36c22fb34aa1245c57d98..3b4d4bb1d9f0f7d9d8a8b1fa530a611ca56660b7 100644 --- a/sm5/smartd.c +++ b/sm5/smartd.c @@ -50,7 +50,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid6="$Id: smartd.c,v 1.93 2003/01/04 17:34:16 pjwilliams Exp $" +const char *CVSid6="$Id: smartd.c,v 1.94 2003/01/04 19:31:38 pjwilliams Exp $" CVSID1 CVSID2 CVSID3 CVSID4 CVSID7; // global variable used for control of printing, passing arguments, etc. @@ -346,6 +346,8 @@ void Usage (void){ #ifdef HAVE_GETOPT_LONG printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO," -d, --debug\n Start smartd in debug mode\n\n"); + printout(LOG_INFO," -D, --showdirectives\n"); + printout(LOG_INFO," Print the configuration file Directives and exit\n\n"); printout(LOG_INFO," -i N, --interval=N\n"); printout(LOG_INFO," Set interval between disk checks to N seconds, where N >= 10\n\n"); printout(LOG_INFO," -V, --version, --license, --copyright\n"); @@ -354,14 +356,12 @@ void Usage (void){ #else printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO," -d Start smartd in debug mode\n"); + printout(LOG_INFO," -D Print the configuration file Directives and exit\n"); printout(LOG_INFO," -i N Set interval between disk checks to N seconds, where N >= 10\n"); printout(LOG_INFO," -V Print License, Copyright, and version information\n"); printout(LOG_INFO," -h Display this help and exit\n"); printout(LOG_INFO," -? Same as -h\n"); #endif - printout(LOG_INFO,"\n"); - printout(LOG_INFO,"Optional configuration file: %s\n",CONFIGFILE); - Directives(); } // returns negative if problem, else fd>=0 @@ -1432,18 +1432,19 @@ void ParseOpts(int argc, char **argv){ int optchar; char *tailptr; long lchecktime; - const char *shortopts = "di:Vh?"; + const char *shortopts = "dDi:Vh?"; #ifdef HAVE_GETOPT_LONG char *arg; struct option longopts[] = { - { "debug", no_argument, 0, 'd' }, - { "interval", required_argument, 0, 'i' }, - { "version", no_argument, 0, 'V' }, - { "license", no_argument, 0, 'V' }, - { "copyright", no_argument, 0, 'V' }, - { "help", no_argument, 0, 'h' }, - { "usage", no_argument, 0, 'h' }, - { 0, 0, 0, 0 } + { "debug", no_argument, 0, 'd' }, + { "showdirectives", no_argument, 0, 'D' }, + { "interval", required_argument, 0, 'i' }, + { "version", no_argument, 0, 'V' }, + { "license", no_argument, 0, 'V' }, + { "copyright", no_argument, 0, 'V' }, + { "help", no_argument, 0, 'h' }, + { "usage", no_argument, 0, 'h' }, + { 0, 0, 0, 0 } }; #endif @@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){ case 'd': debugmode = TRUE; break; + case 'D': + debugmode = TRUE; + Directives(); + exit(0); + break; case 'i': // Period (time interval) for checking // strtol will set errno in the event of overflow, so we'll check it. diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index bc5e325361da72e244f70f18866d7e95842abc04..e994f204e5fb1bc640de45158032e165de410040 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -50,7 +50,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid6="$Id: smartd.cpp,v 1.93 2003/01/04 17:34:16 pjwilliams Exp $" +const char *CVSid6="$Id: smartd.cpp,v 1.94 2003/01/04 19:31:38 pjwilliams Exp $" CVSID1 CVSID2 CVSID3 CVSID4 CVSID7; // global variable used for control of printing, passing arguments, etc. @@ -346,6 +346,8 @@ void Usage (void){ #ifdef HAVE_GETOPT_LONG printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO," -d, --debug\n Start smartd in debug mode\n\n"); + printout(LOG_INFO," -D, --showdirectives\n"); + printout(LOG_INFO," Print the configuration file Directives and exit\n\n"); printout(LOG_INFO," -i N, --interval=N\n"); printout(LOG_INFO," Set interval between disk checks to N seconds, where N >= 10\n\n"); printout(LOG_INFO," -V, --version, --license, --copyright\n"); @@ -354,14 +356,12 @@ void Usage (void){ #else printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO," -d Start smartd in debug mode\n"); + printout(LOG_INFO," -D Print the configuration file Directives and exit\n"); printout(LOG_INFO," -i N Set interval between disk checks to N seconds, where N >= 10\n"); printout(LOG_INFO," -V Print License, Copyright, and version information\n"); printout(LOG_INFO," -h Display this help and exit\n"); printout(LOG_INFO," -? Same as -h\n"); #endif - printout(LOG_INFO,"\n"); - printout(LOG_INFO,"Optional configuration file: %s\n",CONFIGFILE); - Directives(); } // returns negative if problem, else fd>=0 @@ -1432,18 +1432,19 @@ void ParseOpts(int argc, char **argv){ int optchar; char *tailptr; long lchecktime; - const char *shortopts = "di:Vh?"; + const char *shortopts = "dDi:Vh?"; #ifdef HAVE_GETOPT_LONG char *arg; struct option longopts[] = { - { "debug", no_argument, 0, 'd' }, - { "interval", required_argument, 0, 'i' }, - { "version", no_argument, 0, 'V' }, - { "license", no_argument, 0, 'V' }, - { "copyright", no_argument, 0, 'V' }, - { "help", no_argument, 0, 'h' }, - { "usage", no_argument, 0, 'h' }, - { 0, 0, 0, 0 } + { "debug", no_argument, 0, 'd' }, + { "showdirectives", no_argument, 0, 'D' }, + { "interval", required_argument, 0, 'i' }, + { "version", no_argument, 0, 'V' }, + { "license", no_argument, 0, 'V' }, + { "copyright", no_argument, 0, 'V' }, + { "help", no_argument, 0, 'h' }, + { "usage", no_argument, 0, 'h' }, + { 0, 0, 0, 0 } }; #endif @@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){ case 'd': debugmode = TRUE; break; + case 'D': + debugmode = TRUE; + Directives(); + exit(0); + break; case 'i': // Period (time interval) for checking // strtol will set errno in the event of overflow, so we'll check it.