Skip to contentSkip to conversation

exportfs: add the debug option

PATCH Superseded Scott Mayhew 2 participants 2 messages Apr 29, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exportfs: add the debug option

Since calling xlog(D_GENERAL) will cause exportfs to exit with a status of 1, there really should be a way to see those messages for debugging purposes.

---
 utils/exportfs/exportfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/exportfs/exportfs.c +4 -1
index a9151ff..a5eb156 100644
@@ -108,11 +108,14 @@ main(int argc, char **argv)
 	xlog_stderr(1);
 	xlog_syslog(0);
 
-	while ((c = getopt(argc, argv, "afhio:ruvs")) != EOF) {
+	while ((c = getopt(argc, argv, "ad:fhio:ruvs")) != EOF) {
 		switch(c) {
 		case 'a':
 			f_all = 1;
 			break;
+		case 'd':
+			xlog_sconfig(optarg, 1);
+			break;
 		case 'f':
 			force_flush = 1;
 			break;
Signature · 1 line
2.4.11
#1 lore raw
Quoted 16 lines · Scott Mayhew

Since calling xlog(D_GENERAL) will cause exportfs to exit with a status of 1, there really should be a way to see those messages for debugging purposes.

---
 utils/exportfs/exportfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/exportfs/exportfs.c +0 -0
index a9151ff..a5eb156 100644
@@ -108,11 +108,14 @@ main(int argc, char **argv)
 	xlog_stderr(1);
 	xlog_syslog(0);

utils/exportfs/exportfs.c main(int argc, char **argv) · line 118

Quoted 10 lines
utils/exportfs/exportfs.c +4 -1
 
-	while ((c = getopt(argc, argv, "afhio:ruvs")) != EOF) {
+	while ((c = getopt(argc, argv, "ad:fhio:ruvs")) != EOF) {
 		switch(c) {
 		case 'a':
 			f_all = 1;
 			break;
+		case 'd':
+			xlog_sconfig(optarg, 1);
+			break;

I'm all for doing this but there needs to be an usage() update and man page update. For the man page update, just rip the verbiage out of the mountd man page since they are the same.

steved.

Quoted 4 lines
utils/exportfs/exportfs.c +0 -0
 		case 'f':
 			force_flush = 1;
 			break;