mountd: Cleanup how config options are read in
Subsystems (2)
PATCH 2/2 mountd: Add debug processing from nfs.conf
In reply to Steve Dickson--- nfs.conf | 2 +- utils/mountd/mountd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
nfs.conf +1 -1
@@ -30,7 +30,7 @@ # udp-port=0 # [mountd] -# debug=0 +# debug="all|auth|call|general|parse" # manage-gids=n # descriptors=0 # port=0
utils/mountd/mountd.c +3 -0
@@ -684,6 +684,9 @@ read_mount_conf(char **argv)if (s && !state_setup_basedir (argv[0 ], s))exit (1 ); +if ((s =conf_get_str ("mountd" ,"debug" )) !=NULL ) +xlog_sconfig (s,1 ); +/* NOTE: following uses "nfsd" section of nfs.conf !!!! */ if (conf_get_bool ("nfsd" ,"udp" ,NFSCTL_UDPISSET (_rpcprotobits)))NFSCTL_UDPSET (_rpcprotobits);
Signature · 1 line
2.29.2
PATCH 1/2 mountd: Cleanup how config options are read in
--- utils/mountd/mountd.c | 49 +++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-)
utils/mountd/mountd.c +29 -20
@@ -661,30 +661,17 @@ get_exportlist(void)return elist; } -int -main (int argc,char **argv) +int vers; +int port =0 ; +int descriptors =0 ; + +inline static void +read_mount_conf (char **argv) { -char *progname;char *s; -unsigned int listeners =0 ; -int foreground =0 ; -int port =0 ; -int descriptors =0 ; -int c; -int vers; -struct sigaction sa; -struct rlimit rlim; - -/* Set the basename */ -if ((progname =strrchr (argv[0 ],'/' )) !=NULL ) - progname++; -else - progname = argv[0 ]; - -/* Initialize logging. */ -xlog_open (progname);conf_init_file (NFS_CONFFILE ); +xlog_from_conffile ("mountd" ); manage_gids =conf_get_bool ("mountd" ,"manage-gids" , manage_gids); descriptors =conf_get_num ("mountd" ,"descriptors" , descriptors);
@@ -714,7 +701,29 @@ main(int argc, char **argv)else NFSCTL_VERUNSET (nfs_version, vers); } +} + +int +main (int argc,char **argv) +{ +char *progname; +unsigned int listeners =0 ; +int foreground =0 ; +int c; +struct sigaction sa; +struct rlimit rlim; + +/* Set the basename */ +if ((progname =strrchr (argv[0 ],'/' )) !=NULL ) + progname++; +else + progname = argv[0 ]; + +/* Initialize logging. */ +xlog_open (progname); +/* Read in config setting */ +read_mount_conf (argv);/* Parse the command line options and arguments. */ opterr =0 ;
Signature · 1 line
2.29.2
Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
In reply to Steve DicksonQuoted 1 line · Steve Dickson
Signed-off-by Steve Dickson <[email protected]>
Committed... (tag: nfs-utils-2-5-3-rc5)
steved.
Quoted 33 lines
--- nfs.conf | 2 +- utils/mountd/mountd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)nfs.conf +1
-1@@ -30,7 +30,7 @@ # udp-port=0 # [mountd] -# debug=0 +# debug="all|auth|call|general|parse" # manage-gids=n # descriptors=0 # port=0utils/mountd/mountd.c +3
-0@@ -684,6 +684,9 @@ read_mount_conf(char **argv)if (s && !state_setup_basedir (argv[0 ], s))exit (1 ); +if ((s =conf_get_str ("mountd" ,"debug" )) !=NULL ) +xlog_sconfig (s,1 ); +/* NOTE: following uses "nfsd" section of nfs.conf !!!! */ if (conf_get_bool ("nfsd" ,"udp" ,NFSCTL_UDPISSET (_rpcprotobits)))NFSCTL_UDPSET (_rpcprotobits);
Quoted 1 line · Steve Dickson
Signed-off-by Steve Dickson <[email protected]>
Committed... (tag: nfs-utils-2-5-3-rc5)
steved.
Quoted 77 lines
--- utils/mountd/mountd.c | 49 +++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-)utils/mountd/mountd.c +29
-20@@ -661,30 +661,17 @@ get_exportlist(void)return elist; } -int -main (int argc,char **argv) +int vers; +int port =0 ; +int descriptors =0 ; + +inline static void +read_mount_conf (char **argv) { -char *progname;char *s; -unsigned int listeners =0 ; -int foreground =0 ; -int port =0 ; -int descriptors =0 ; -int c; -int vers; -struct sigaction sa; -struct rlimit rlim; - -/* Set the basename */ -if ((progname =strrchr (argv[0 ],'/' )) !=NULL ) - progname++; -else - progname = argv[0 ]; - -/* Initialize logging. */ -xlog_open (progname);conf_init_file (NFS_CONFFILE ); +xlog_from_conffile ("mountd" ); manage_gids =conf_get_bool ("mountd" ,"manage-gids" , manage_gids); descriptors =conf_get_num ("mountd" ,"descriptors" , descriptors);@@ -714,7 +701,29 @@ main(int argc, char **argv)else NFSCTL_VERUNSET (nfs_version, vers); } +} + +int +main (int argc,char **argv) +{ +char *progname; +unsigned int listeners =0 ; +int foreground =0 ; +int c; +struct sigaction sa; +struct rlimit rlim; + +/* Set the basename */ +if ((progname =strrchr (argv[0 ],'/' )) !=NULL ) + progname++; +else + progname = argv[0 ]; + +/* Initialize logging. */ +xlog_open (progname); +/* Read in config setting */ +read_mount_conf (argv);/* Parse the command line options and arguments. */ opterr =0 ;
NeilBrown
reviewerRe: [PATCH 2/2] mountd: Add debug processing from nfs.conf
In reply to Steve DicksonQuoted 24 lines · Steve Dickson
Signed-off-by Steve Dickson <[email protected]>--- nfs.conf | 2 +- utils/mountd/mountd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)nfs.conf +1
-1@@ -30,7 +30,7 @@ # udp-port=0 # [mountd] -# debug=0 +# debug="all|auth|call|general|parse" # manage-gids=n # descriptors=0 # port=0utils/mountd/mountd.c +0
-0
utils/mountd/mountd.c read_mount_conf(char **argv) · line 689
Quoted 6 lines
utils/mountd/mountd.c +3
-0@@ -684,6 +684,9 @@ read_mount_conf(char **argv)if (s && !state_setup_basedir (argv[0 ], s))exit (1 ); +if ((s =conf_get_str ("mountd" ,"debug" )) !=NULL ) +xlog_sconfig (s,1 ); +
Why is this needed?
A few lines higher up is
xlog_from_conffile("mountd");
which calls
kinds = conf_get_list(service, "debug");
and passes each word that it finds to xlog_sconfig() ??
I just tested setting "debug=all" in the mountd section of nfs.conf, and it seems to work without this patch.
Thanks,
NeilBrown
Quoted 5 lines
utils/mountd/mountd.c +0
-0/* NOTE: following uses "nfsd" section of nfs.conf !!!! */ if (conf_get_bool ("nfsd" ,"udp" ,NFSCTL_UDPISSET (_rpcprotobits)))NFSCTL_UDPSET (_rpcprotobits);Signature · 1 line
2.29.2
Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
Quoted 41 lines · NeilBrown
Quoted 24 lines · Steve Dickson
Signed-off-by Steve Dickson <[email protected]>--- nfs.conf | 2 +- utils/mountd/mountd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)nfs.conf +1
-1@@ -30,7 +30,7 @@ # udp-port=0 # [mountd] -# debug=0 +# debug="all|auth|call|general|parse" # manage-gids=n # descriptors=0 # port=0utils/mountd/mountd.c +0
-0utils/mountd/mountd.c read_mount_conf(char **argv) · line 689
Quoted 6 lines
utils/mountd/mountd.c +3
-0@@ -684,6 +684,9 @@ read_mount_conf(char **argv)if (s && !state_setup_basedir (argv[0 ], s))exit (1 ); +if ((s =conf_get_str ("mountd" ,"debug" )) !=NULL ) +xlog_sconfig (s,1 ); +Why is this needed?
A few lines higher up is
xlog_from_conffile("mountd");
which calls
kinds =conf_get_list(service, "debug");
and passes each word that it finds toxlog_sconfig()??
Quoted 2 lines
I just tested setting "debug=all" in the mountd section of nfs.conf, and it seems to work without this patch.
No it is not... I didn't realize xlog_from_conffile() process the debug config variable... maybe we should change the name to something like xlog_debug_conffile()... something more descriptive as to what it does.
I will clean it up... in a bit.
steved.
Quoted 10 lines
Thanks,
NeilBrownQuoted 5 lines
utils/mountd/mountd.c +0
-0/* NOTE: following uses "nfsd" section of nfs.conf !!!! */ if (conf_get_bool ("nfsd" ,"udp" ,NFSCTL_UDPISSET (_rpcprotobits)))NFSCTL_UDPSET (_rpcprotobits);Signature · 1 line
2.29.2
NeilBrown
reviewerRe: [PATCH 2/2] mountd: Add debug processing from nfs.conf
Quoted 42 lines · Steve Dickson
Quoted 41 lines · NeilBrown
Quoted 24 lines · Steve Dickson
Signed-off-by Steve Dickson <[email protected]>--- nfs.conf | 2 +- utils/mountd/mountd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)nfs.conf +1
-1@@ -30,7 +30,7 @@ # udp-port=0 # [mountd] -# debug=0 +# debug="all|auth|call|general|parse" # manage-gids=n # descriptors=0 # port=0utils/mountd/mountd.c +0
-0utils/mountd/mountd.c read_mount_conf(char **argv) · line 689
Quoted 6 lines
utils/mountd/mountd.c +3
-0@@ -684,6 +684,9 @@ read_mount_conf(char **argv)if (s && !state_setup_basedir (argv[0 ], s))exit (1 ); +if ((s =conf_get_str ("mountd" ,"debug" )) !=NULL ) +xlog_sconfig (s,1 ); +Why is this needed?
A few lines higher up is
xlog_from_conffile("mountd");
which calls
kinds =conf_get_list(service, "debug");
and passes each word that it finds toxlog_sconfig()??
Quoted 8 lines
Quoted 2 lines
I just tested setting "debug=all" in the mountd section of nfs.conf, and it seems to work without this patch.
No it is not... I didn't realize
xlog_from_conffile()process the debug config variable... maybe we should change the name to something likexlog_debug_conffile()... something more descriptive as to what it does.I will clean it up... in a bit.
Thanks. I agree that including "debug" in that function name would help. Maybe "conffile_set_debug()", or your suggestion.
Thanks,
NeilBrown