mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-12-05 22:08:19 +00:00
"sensord" no longer needs a default configuration file name. If no
file name is provided on the command line, use the libsensors default. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4987 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
f17e1cf5a8
commit
6d5292cce4
4 files changed
+10
-11
No files matched your search
@@ -4,6 +4,7 @@ lm-sensors CHANGES file
|
|||||||
SVN HEAD
|
SVN HEAD
|
||||||
libsensors: Add a default configuration file
|
libsensors: Add a default configuration file
|
||||||
sensord: Reload config on SIGHUP rather than automatically
|
sensord: Reload config on SIGHUP rather than automatically
|
||||||
|
No default configuration file name
|
||||||
sensors: Fix file handle leak on library initialization error
|
sensors: Fix file handle leak on library initialization error
|
||||||
Handle the case where voltage measurements aren't available
|
Handle the case where voltage measurements aren't available
|
||||||
No default configuration file name
|
No default configuration file name
|
||||||
|
|||||||
+3
-5
@@ -30,12 +30,10 @@
|
|||||||
#include "lib/error.h"
|
#include "lib/error.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#define DEFAULT_CONFIG_FILE ETCDIR "/sensors.conf"
|
|
||||||
|
|
||||||
#define MAX_CHIP_NAMES 32
|
#define MAX_CHIP_NAMES 32
|
||||||
|
|
||||||
int isDaemon = 0;
|
int isDaemon = 0;
|
||||||
const char *sensorsCfgFile = DEFAULT_CONFIG_FILE;
|
const char *sensorsCfgFile = NULL;
|
||||||
const char *pidFile = "/var/run/sensord.pid";
|
const char *pidFile = "/var/run/sensord.pid";
|
||||||
const char *rrdFile = NULL;
|
const char *rrdFile = NULL;
|
||||||
const char *cgiDir = NULL;
|
const char *cgiDir = NULL;
|
||||||
@@ -104,7 +102,7 @@ static const char *daemonSyntax =
|
|||||||
" -t, --rrd-interval <time> -- interval between updating RRD file (default 5m)\n"
|
" -t, --rrd-interval <time> -- interval between updating RRD file (default 5m)\n"
|
||||||
" -T, --rrd-no-average -- switch RRD in non-average mode\n"
|
" -T, --rrd-no-average -- switch RRD in non-average mode\n"
|
||||||
" -r, --rrd-file <file> -- RRD file (default <none>)\n"
|
" -r, --rrd-file <file> -- RRD file (default <none>)\n"
|
||||||
" -c, --config-file <file> -- configuration file (default " DEFAULT_CONFIG_FILE ")\n"
|
" -c, --config-file <file> -- configuration file\n"
|
||||||
" -p, --pid-file <file> -- PID file (default /var/run/sensord.pid)\n"
|
" -p, --pid-file <file> -- PID file (default /var/run/sensord.pid)\n"
|
||||||
" -f, --syslog-facility <f> -- syslog facility to use (default local4)\n"
|
" -f, --syslog-facility <f> -- syslog facility to use (default local4)\n"
|
||||||
" -g, --rrd-cgi <img-dir> -- output an RRD CGI script and exit\n"
|
" -g, --rrd-cgi <img-dir> -- output an RRD CGI script and exit\n"
|
||||||
@@ -129,7 +127,7 @@ static const char *appSyntax =
|
|||||||
" -a, --alarm-scan -- only scan for alarms\n"
|
" -a, --alarm-scan -- only scan for alarms\n"
|
||||||
" -s, --set -- execute set statements (root only)\n"
|
" -s, --set -- execute set statements (root only)\n"
|
||||||
" -r, --rrd-file <file> -- only update RRD file\n"
|
" -r, --rrd-file <file> -- only update RRD file\n"
|
||||||
" -c, --config-file <file> -- configuration file (default " DEFAULT_CONFIG_FILE ")\n"
|
" -c, --config-file <file> -- configuration file\n"
|
||||||
" -d, --debug -- display some debug information\n"
|
" -d, --debug -- display some debug information\n"
|
||||||
" -v, --version -- display version and exit\n"
|
" -v, --version -- display version and exit\n"
|
||||||
" -h, --help -- display help and exit\n"
|
" -h, --help -- display help and exit\n"
|
||||||
|
|||||||
+4
-4
@@ -38,7 +38,7 @@ loadConfig
|
|||||||
FILE *cfg = NULL;
|
FILE *cfg = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!strcmp (cfgPath, "-")) {
|
if (cfgPath && !strcmp (cfgPath, "-")) {
|
||||||
if (!reload) {
|
if (!reload) {
|
||||||
if ((ret = sensors_init (stdin))) {
|
if ((ret = sensors_init (stdin))) {
|
||||||
sensorLog (LOG_ERR, "Error loading sensors configuration file <stdin>: %s",
|
sensorLog (LOG_ERR, "Error loading sensors configuration file <stdin>: %s",
|
||||||
@@ -46,7 +46,7 @@ loadConfig
|
|||||||
ret = 12;
|
ret = 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (stat (cfgPath, &stats) < 0) {
|
} else if (cfgPath && stat (cfgPath, &stats) < 0) {
|
||||||
sensorLog (LOG_ERR, "Error stating sensors configuration file: %s", cfgPath);
|
sensorLog (LOG_ERR, "Error stating sensors configuration file: %s", cfgPath);
|
||||||
ret = 10;
|
ret = 10;
|
||||||
} else {
|
} else {
|
||||||
@@ -54,12 +54,12 @@ loadConfig
|
|||||||
sensorLog (LOG_INFO, "configuration reloading");
|
sensorLog (LOG_INFO, "configuration reloading");
|
||||||
sensors_cleanup ();
|
sensors_cleanup ();
|
||||||
}
|
}
|
||||||
if (!(cfg = fopen (cfgPath, "r"))) {
|
if (cfgPath && !(cfg = fopen (cfgPath, "r"))) {
|
||||||
sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath);
|
sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath);
|
||||||
ret = 11;
|
ret = 11;
|
||||||
} else if ((ret = sensors_init (cfg))) {
|
} else if ((ret = sensors_init (cfg))) {
|
||||||
sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s",
|
sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s",
|
||||||
cfgPath, sensors_strerror (ret));
|
cfgPath ? cfgPath : "(default)", sensors_strerror (ret));
|
||||||
ret = 11;
|
ret = 11;
|
||||||
}
|
}
|
||||||
if (cfg)
|
if (cfg)
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ below for more details.
|
|||||||
.IP "-c, --config-file file"
|
.IP "-c, --config-file file"
|
||||||
Specify a
|
Specify a
|
||||||
.BR libsensors (3)
|
.BR libsensors (3)
|
||||||
configuration file. If no file is specified, the default configuration file
|
configuration file. If no file is specified, the libsensors default
|
||||||
is used.
|
configuration file is used.
|
||||||
|
|
||||||
.IP "-p, --pid-file file"
|
.IP "-p, --pid-file file"
|
||||||
Specify what PID file to write; the default is to write the file
|
Specify what PID file to write; the default is to write the file
|
||||||
|
|||||||
Reference in new issue
Block a user