Skip to content
Snippets Groups Projects
Commit f318313b authored by pjwilliams's avatar pjwilliams
Browse files

Added -D, --showdirectives option to smartd

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@420 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 45bea63a
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools 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> Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
...@@ -36,6 +36,8 @@ CURRENT RELEASE (see VERSION file in this directory): ...@@ -36,6 +36,8 @@ CURRENT RELEASE (see VERSION file in this directory):
smartmontools-5.1.1 smartmontools-5.1.1
[PW] Added -D, --showdirectives option to smartd
[DG] add '-l selftest' capability for SCSI devices (update smartctl.8) [DG] add '-l selftest' capability for SCSI devices (update smartctl.8)
[BA] smartd,smartctl: added additional Attribute modification option [BA] smartd,smartctl: added additional Attribute modification option
......
...@@ -249,5 +249,6 @@ Changes to smartd options: ...@@ -249,5 +249,6 @@ Changes to smartd options:
-V --version, --copyright, --license -V --version, --copyright, --license -V --version, --copyright, --license -V --version, --copyright, --license
-X --debug -d --debug -X --debug -d --debug
-i N --interval=N -i N --interval=N
-D --showdirectives
---------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------
\# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> \# 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 \# 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 \# under the terms of the GNU General Public License as published by the Free
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
\# Research Center), Jack Baskin School of Engineering, University of \# Research Center), Jack Baskin School of Engineering, University of
\# California, Santa Cruz. http://ssrc.soe.ucsc.edu/ \# 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 .SH NAME
smartd \- S.M.A.R.T. Daemon smartd \- S.M.A.R.T. Daemon
.SH SYNOPSIS .SH SYNOPSIS
...@@ -105,6 +105,9 @@ in "debug" mode. In this mode, it does not ...@@ -105,6 +105,9 @@ in "debug" mode. In this mode, it does not
(2) and displays status information to STDOUT. It also prints more (2) and displays status information to STDOUT. It also prints more
verbose information about what it is doing. verbose information about what it is doing.
.TP .TP
.B \-D, \-\-showdirectives
Prints the configuration file Directives to STDOUT and exits.
.TP
.B \-i N, \-\-interval=N .B \-i N, \-\-interval=N
Sets the interval between disk checks to Sets the interval between disk checks to
.I N .I N
...@@ -684,4 +687,4 @@ Please let us know if there is an on\-line source for this document. ...@@ -684,4 +687,4 @@ Please let us know if there is an on\-line source for this document.
.SH .SH
CVS ID OF THIS PAGE: 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 $
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
// CVS ID strings // CVS ID strings
extern const char *CVSid1, *CVSid2; 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; CVSID1 CVSID2 CVSID3 CVSID4 CVSID7;
// global variable used for control of printing, passing arguments, etc. // global variable used for control of printing, passing arguments, etc.
...@@ -346,6 +346,8 @@ void Usage (void){ ...@@ -346,6 +346,8 @@ void Usage (void){
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO,"Command Line Options:\n");
printout(LOG_INFO," -d, --debug\n Start smartd in debug mode\n\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," -i N, --interval=N\n");
printout(LOG_INFO," Set interval between disk checks to N seconds, where N >= 10\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"); printout(LOG_INFO," -V, --version, --license, --copyright\n");
...@@ -354,14 +356,12 @@ void Usage (void){ ...@@ -354,14 +356,12 @@ void Usage (void){
#else #else
printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO,"Command Line Options:\n");
printout(LOG_INFO," -d Start smartd in debug mode\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," -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," -V Print License, Copyright, and version information\n");
printout(LOG_INFO," -h Display this help and exit\n"); printout(LOG_INFO," -h Display this help and exit\n");
printout(LOG_INFO," -? Same as -h\n"); printout(LOG_INFO," -? Same as -h\n");
#endif #endif
printout(LOG_INFO,"\n");
printout(LOG_INFO,"Optional configuration file: %s\n",CONFIGFILE);
Directives();
} }
// returns negative if problem, else fd>=0 // returns negative if problem, else fd>=0
...@@ -1432,11 +1432,12 @@ void ParseOpts(int argc, char **argv){ ...@@ -1432,11 +1432,12 @@ void ParseOpts(int argc, char **argv){
int optchar; int optchar;
char *tailptr; char *tailptr;
long lchecktime; long lchecktime;
const char *shortopts = "di:Vh?"; const char *shortopts = "dDi:Vh?";
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
char *arg; char *arg;
struct option longopts[] = { struct option longopts[] = {
{ "debug", no_argument, 0, 'd' }, { "debug", no_argument, 0, 'd' },
{ "showdirectives", no_argument, 0, 'D' },
{ "interval", required_argument, 0, 'i' }, { "interval", required_argument, 0, 'i' },
{ "version", no_argument, 0, 'V' }, { "version", no_argument, 0, 'V' },
{ "license", no_argument, 0, 'V' }, { "license", no_argument, 0, 'V' },
...@@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){ ...@@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){
case 'd': case 'd':
debugmode = TRUE; debugmode = TRUE;
break; break;
case 'D':
debugmode = TRUE;
Directives();
exit(0);
break;
case 'i': case 'i':
// Period (time interval) for checking // Period (time interval) for checking
// strtol will set errno in the event of overflow, so we'll check it. // strtol will set errno in the event of overflow, so we'll check it.
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
// CVS ID strings // CVS ID strings
extern const char *CVSid1, *CVSid2; 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; CVSID1 CVSID2 CVSID3 CVSID4 CVSID7;
// global variable used for control of printing, passing arguments, etc. // global variable used for control of printing, passing arguments, etc.
...@@ -346,6 +346,8 @@ void Usage (void){ ...@@ -346,6 +346,8 @@ void Usage (void){
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO,"Command Line Options:\n");
printout(LOG_INFO," -d, --debug\n Start smartd in debug mode\n\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," -i N, --interval=N\n");
printout(LOG_INFO," Set interval between disk checks to N seconds, where N >= 10\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"); printout(LOG_INFO," -V, --version, --license, --copyright\n");
...@@ -354,14 +356,12 @@ void Usage (void){ ...@@ -354,14 +356,12 @@ void Usage (void){
#else #else
printout(LOG_INFO,"Command Line Options:\n"); printout(LOG_INFO,"Command Line Options:\n");
printout(LOG_INFO," -d Start smartd in debug mode\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," -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," -V Print License, Copyright, and version information\n");
printout(LOG_INFO," -h Display this help and exit\n"); printout(LOG_INFO," -h Display this help and exit\n");
printout(LOG_INFO," -? Same as -h\n"); printout(LOG_INFO," -? Same as -h\n");
#endif #endif
printout(LOG_INFO,"\n");
printout(LOG_INFO,"Optional configuration file: %s\n",CONFIGFILE);
Directives();
} }
// returns negative if problem, else fd>=0 // returns negative if problem, else fd>=0
...@@ -1432,11 +1432,12 @@ void ParseOpts(int argc, char **argv){ ...@@ -1432,11 +1432,12 @@ void ParseOpts(int argc, char **argv){
int optchar; int optchar;
char *tailptr; char *tailptr;
long lchecktime; long lchecktime;
const char *shortopts = "di:Vh?"; const char *shortopts = "dDi:Vh?";
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
char *arg; char *arg;
struct option longopts[] = { struct option longopts[] = {
{ "debug", no_argument, 0, 'd' }, { "debug", no_argument, 0, 'd' },
{ "showdirectives", no_argument, 0, 'D' },
{ "interval", required_argument, 0, 'i' }, { "interval", required_argument, 0, 'i' },
{ "version", no_argument, 0, 'V' }, { "version", no_argument, 0, 'V' },
{ "license", no_argument, 0, 'V' }, { "license", no_argument, 0, 'V' },
...@@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){ ...@@ -1459,6 +1460,11 @@ void ParseOpts(int argc, char **argv){
case 'd': case 'd':
debugmode = TRUE; debugmode = TRUE;
break; break;
case 'D':
debugmode = TRUE;
Directives();
exit(0);
break;
case 'i': case 'i':
// Period (time interval) for checking // Period (time interval) for checking
// strtol will set errno in the event of overflow, so we'll check it. // strtol will set errno in the event of overflow, so we'll check it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment