[libvirt] [PATCH] remote: Improve daemon startup error reporting

If I toggle enable_tcp in libvirtd.conf and add --listen in /etc/init.d/libvirtd, I get the unhelpful error: Starting libvirtd daemon: error: Unable to initialize network sockets. Running without --daemon provides much more useful info: sudo libvirtd --listen 11:29:26.117: error : remoteCheckCertFile:270 : Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory The daemon architecture makes it difficult to report this useful info if daemonized, so point users to /var/log/messages and dropping the --daemon flag if they want more info. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- daemon/libvirtd.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index fefa7aa..cee6f13 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -474,7 +474,10 @@ static int daemonForkIntoBackground(void) { goto again; if (ret == 1 && status != 0) { - fprintf(stderr, "error: %s\n", virDaemonErrTypeToString(status)); + fprintf(stderr, + "error: %s. Check /var/log/messages or run without " + "--daemon for more info.\n", + virDaemonErrTypeToString(status)); } _exit(ret == 1 && status == 0 ? 0 : 1); } -- 1.6.5.2

On Wed, Feb 24, 2010 at 12:55:18PM -0500, Cole Robinson wrote:
If I toggle enable_tcp in libvirtd.conf and add --listen in /etc/init.d/libvirtd, I get the unhelpful error:
Starting libvirtd daemon: error: Unable to initialize network sockets.
Running without --daemon provides much more useful info:
sudo libvirtd --listen 11:29:26.117: error : remoteCheckCertFile:270 : Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
The daemon architecture makes it difficult to report this useful info if daemonized, so point users to /var/log/messages and dropping the --daemon flag if they want more info.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- daemon/libvirtd.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index fefa7aa..cee6f13 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -474,7 +474,10 @@ static int daemonForkIntoBackground(void) { goto again;
if (ret == 1 && status != 0) { - fprintf(stderr, "error: %s\n", virDaemonErrTypeToString(status)); + fprintf(stderr, + "error: %s. Check /var/log/messages or run without " + "--daemon for more info.\n", + virDaemonErrTypeToString(status)); } _exit(ret == 1 && status == 0 ? 0 : 1); }
ACk, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Cole Robinson
-
Daniel Veillard