ndctl, monitor: fix the severity of the "daemon started" message
Vishal Verma
maintainerPATCH 1/2 ndctl, monitor: fix the severity of the "daemon started" message
The above message was printed as an error, but it is just an informational message. Change it to dbg().
--- ndctl/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/monitor.c +1 -1
@@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; } -err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" ); +dbg ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" ); }if (parse_monitor_event (&monitor, (struct ndctl_ctx *)ctx))
Signature · 6 lines
2.17.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Vishal Verma
maintainerPATCH 2/2 ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
When we are running as a daemon, it is preferred to exit successfully when no DIMMs are found. When running in the foreground, retain an error return so that the user can be notified that nothing was found to monitor.
In the longer term, replace this with a libudev uevent monitor that will look for DIMM addition/removal events, and update the running monitor(s) if the DIMMs match the active filter spec.
--- ndctl/monitor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
ndctl/monitor.c +3 -2
@@ -681,8 +681,9 @@ int cmd_monitor(int argc, const char **argv, void *ctx) goto out;if (!mfa.num_dimm) { -err ((struct ndctl_ctx *)ctx,"no dimms to monitor\n" ); - rc = -ENXIO ; +dbg ((struct ndctl_ctx *)ctx,"no dimms to monitor\n" ); +if (!monitor.daemon) + rc = -ENXIO ; goto out; }
Signature · 6 lines
2.17.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Re: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
Quoted 12 lines · Vishal Verma
When we are running as a daemon, it is preferred to exit successfully when no DIMMs are found. When running in the foreground, retain an error
return so that the user can be notified that nothing was found to monitor.In the longer term, replace this with a libudev uevent monitor that will
look for DIMM addition/removal events, and update the running monitor(s)
if the DIMMs match the active filter spec.
Quoted 3 lines
Reported-by Andreas Hasenack <[email protected]>Cc Dan Williams <[email protected]>
Looks good to me, if no one is sticking around to reap the error might as well claim success.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
RE: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
In reply to Vishal VermaQuoted 43 lines
-----Original Message-----
From: Vishal Verma [mailto:[email protected]]
Sent: Friday, October 5, 2018 9:01 AM
To: [email protected]
Cc: Qi, Fuli/斉 福利 <[email protected]>; Andreas Hasenack <[email protected]>; Vishal Verma <[email protected]>; Dan Williams <[email protected]>
Subject: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are foundWhen we are running as a daemon, it is preferred to exit successfully when no DIMMs are found. When running in the foreground, retain an error return so that the user can be notified that nothing was found to monitor.
In the longer term, replace this with a libudev uevent monitor that will look for DIMM addition/removal events, and update the running monitor(s) if the DIMMs match the active filter spec.
Reported-by Andreas Hasenack <[email protected]>Cc Dan Williams <[email protected]>Cc QI Fuli <[email protected]>Signed-off-by Vishal Verma <[email protected]>--- ndctl/monitor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)ndctl/monitor.c +3
-3@@ -681,8 +681,9 @@ int cmd_monitor(int argc, const char **argv, void *ctx) goto out;if (!mfa.num_dimm) { -err ((struct ndctl_ctx *)ctx,"no dimms to monitor\n" ); - rc = -ENXIO ; +dbg ((struct ndctl_ctx *)ctx,"no dimms to monitor\n" ); +if (!monitor.daemon) + rc = -ENXIO ; goto out; } --
Quoted 2 lines
2.17.1
Looks good to me.
Thank you very much,
QI Fuli
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 5 lines · Vishal Verma
The above message was printed as an error, but it is just an informational message. Change it to
dbg().Cc QI Fuli <[email protected]>Cc Dan Williams <[email protected]>
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Hi, Vishal-san,
Quoted 2 lines
The above message was printed as an error, but it is just an informational message. Change it to
dbg().
Hmmmmmmm.
When I was a engineer for trouble-shooting of customer's Linux system, the starting time and the ending time of any daemon was very helpful for investigating their trouble.
So, I think it is not only for developer, but also it is essential for trouble-shooter for custmer support.
(It may be also same with system operator)
Quoted 13 lines
Cc QI Fuli <[email protected]>Cc Dan Williams <[email protected]>Signed-off-by Vishal Verma <[email protected]>--- ndctl/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ndctl/monitor.c +0
-0
ndctl/monitor.c int cmd_monitor(int argc, const char **argv, void *ctx) · line 663
Quoted 5 lines
ndctl/monitor.c +1
-1@@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; } -err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" ); +dbg ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" );
Though I agree its message is not "error" certainly, I would like to keep it as normal status level message.
Thanks,
---
Yasunori Goto
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 25 lines · Yasunori Goto
Hi, Vishal-san,
Quoted 2 lines
The above message was printed as an error, but it is just an informational message. Change it to
dbg().Hmmmmmmm.
When I was a engineer for trouble-shooting of customer's Linux system, the starting time and the ending time of any daemon was very helpful for investigating their trouble.
So, I think it is not only for developer, but also it is essential for trouble-shooter for custmer support.
(It may be also same with system operator)Quoted 8 lines
Cc QI Fuli <[email protected]>Cc Dan Williams <[email protected]>Signed-off-by Vishal Verma <[email protected]>--- ndctl/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
ndctl/monitor.c int cmd_monitor(int argc, const char **argv, void *ctx) · line 663
Quoted 10 lines
ndctl/monitor.c +1
-1@@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; } -err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" ); +dbg ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" );Though I agree its message is not "error" certainly, I would like to keep it as normal status level message.
Sounds good to me.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 51 lines
-----Original Message-----
From: Linux-nvdimm [mailto:[email protected]] On Behalf Of Dan Williams
Sent: Friday, October 5, 2018 1:24 PM
To: Gotou, Yasunori/五島 康文 <[email protected]>
Cc: [email protected]; linux-nvdimm <[email protected]>
Subject: Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" messageQuoted 25 lines · Yasunori Goto
Hi, Vishal-san,
Quoted 2 lines
The above message was printed as an error, but it is just an informational message. Change it to
dbg().Hmmmmmmm.
When I was a engineer for trouble-shooting of customer's Linux system, the starting time and the ending time of any daemon was very helpful for investigating their trouble.
So, I think it is not only for developer, but also it is essential for trouble-shooter for custmer support.
(It may be also same with system operator)Quoted 8 lines
Cc QI Fuli <[email protected]>Cc Dan Williams <[email protected]>Signed-off-by Vishal Verma <[email protected]>--- ndctl/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 15 lines
ndctl/monitor.c int cmd_monitor(int argc, const char **argv, void *ctx) · line 664
Quoted 11 lines
ndctl/monitor.c index renamed from ndctl/monitor.c +0
-0d29e378..b44f946 100644
ndctl/monitor.c +2
-1@@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; } -err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" ); +dbg ((struct ndctl_ctx *)ctx,"ndctl monitor daemon + started\n");Though I agree its message is not "error" certainly, I would like to keep it as normal status level message.
Quoted 1 line
Sounds good to me.
In my original idea, I just wanted to log the "daemon started" message.
After thinking more about it, I agree that the message is not at "error" level.
However, considering this message will be helpful for some users like system operators,
how about changing this message level to "info" and meanwhile changing the default log level to "LOG_INFO" as following?
ndctl/monitor.c +2 -2
@@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)if (monitor.verbose)ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_DEBUG );else -ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_NOTICE ); +ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_INFO ); rc =read_config_file ((struct ndctl_ctx *)ctx, &monitor, ¶m);if (rc)
@@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)if (!monitor.log ||strncmp (monitor.log,"./" ,2 ) ==0 )ndctl_set_log_fn ((struct ndctl_ctx *)ctx, log_syslog);if (daemon (0 ,0 ) !=0 ) { -err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); +info ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; }err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" );
Thank you very much,
QI Fuli
Quoted 4 lines
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 37 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Sounds good to me.
In my original idea, I just wanted to log the "daemon started" message. After thinking more about it, I agree that the message is not at "error" level. However, considering this message will be helpful for some users like system
operators,
Quoted 1 line
how about changing this message level to "info" and meanwhile changing the
default log level to "
LOG_INFO" as following?Quoted 15 lines
ndctl/monitor.c +1
-1@@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)if (monitor.verbose)ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_DEBUG );else -ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_NOTICE ); +ndctl_set_log_priority ((struct ndctl_ctx *)ctx,LOG_INFO ); rc =read_config_file ((struct ndctl_ctx *)ctx, &monitor, ¶m);if (rc)ndctl/monitor.c int cmd_monitor(int argc, const char **argv, void *ctx) · line 663
Quoted 8 lines
ndctl/monitor.c +1
-1@@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)if (!monitor.log ||strncmp (monitor.log,"./" ,2 ) ==0 )ndctl_set_log_fn ((struct ndctl_ctx *)ctx, log_syslog);if (daemon (0 ,0 ) !=0 ) { -err ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); +info ((struct ndctl_ctx *)ctx,"daemon start failed\n" ); goto out; }err ((struct ndctl_ctx *)ctx,"ndctl monitor daemon started\n" );Yes, this looks good to me. Will you send a proper patch for this, and I can replace my patch with yours.
Quoted 3 lines
Thanks,
-Vishal
Ok, I will send a patch.
Quoted 9 lines
Quoted 9 lines
Thank you very much,
QI FuliQuoted 4 lines
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm