@@ -41,6 +41,7 @@ void xlog_stderr(int on);
void xlog_syslog(int on);
void xlog_config(int fac, int on);
void xlog_sconfig(char *, int on);
+void xlog_from_conffile(char *);
int xlog_enabled(int fac);
void xlog(int fac, const char *fmt, ...);
void xlog_warn(const char *fmt, ...);
@@ -29,6 +29,7 @@
#include <syslog.h>
#include <errno.h>
#include "nfslib.h"
+#include "conffile.h"
#undef VERBOSE_PRINTF
@@ -125,6 +126,19 @@ xlog_sconfig(char *kind, int on)
xlog_config(tbl->df_fac, on);
}
+void
+xlog_from_conffile(char *service)
+{
+ struct conf_list *kinds;
+ struct conf_list_node *n;
+
+ kinds = conf_get_list(service, "debug");
+ if (!kinds || !kinds->cnt)
+ return;
+ TAILQ_FOREACH(n, &(kinds->fields), link)
+ xlog_sconfig(n->field, 1);
+}
+
int
xlog_enabled(int fac)
{
@@ -86,7 +86,15 @@ can be used for "false". Comparisons are case-insensitive.
.SH SECTIONS
The following sections are known to various programs, and can contain
-the given named values.
+the given named values. Most sections can also contain a
+.B debug
+value, which can be one or more from the list
+.BR general ,
+.BR call ,
+.BR auth ,
+.BR parse ,
+.BR all .
+When a list is given, the members should be comma-separated.
.TP
.B nfsdcltrack
Recognized values:
@@ -675,6 +675,7 @@ main(int argc, char **argv)
progname = argv[0];
conf_init();
+ xlog_from_conffile("mountd");
manage_gids = conf_get_bool("mountd", "manage-gids", manage_gids);
descriptors = conf_get_num("mountd", "descriptors", descriptors);
port = conf_get_num("mountd", "port", port);
@@ -80,6 +80,7 @@ main(int argc, char **argv)
xlog_stderr(1);
conf_init();
+ xlog_from_conffile("nfsd");
count = conf_get_num("nfsd", "threads", count);
grace = conf_get_num("nfsd", "grace-time", grace);
lease = conf_get_num("nfsd", "lease-time", lease);
@@ -567,6 +567,7 @@ main(int argc, char **argv)
xlog_stderr(0);
conf_init();
+ xlog_from_conffile("nfsdcltrack");
val = conf_get_str("nfsdcltrack", "storagedir");
if (val)
storagedir = val;
@@ -490,6 +490,7 @@ main(int argc, char **argv)
progname = argv[0];
conf_init();
+ xlog_from_conffile("sm-notify");
opt_max_retry = conf_get_num("sm-notify", "retry-time", opt_max_retry / 60) * 60;
opt_srcport = conf_get_str("sm-notify", "outgoing-port");
opt_srcaddr = conf_get_str("sm-notify", "outgoing-addr");
@@ -275,6 +275,7 @@ int main (int argc, char **argv)
MY_NAME = NULL;
conf_init();
+ xlog_from_conffile("statd");
out_port = conf_get_num("statd", "outgoing-port", out_port);
port = conf_get_num("statd", "port", port);
MY_NAME = conf_get_str("statd", "name");
The value is from the list general, call, auth, parse, all. Most daemons recognise this in their dedicated section. Signed-off-by: NeilBrown <neilb@suse.com> --- support/include/xlog.h | 1 + support/nfs/xlog.c | 14 ++++++++++++++ systemd/nfs.conf.man | 10 +++++++++- utils/mountd/mountd.c | 1 + utils/nfsd/nfsd.c | 1 + utils/nfsdcltrack/nfsdcltrack.c | 1 + utils/statd/sm-notify.c | 1 + utils/statd/statd.c | 1 + 8 files changed, 29 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html