The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4461

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Should make debugging startup failures a bit easier.

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
From dbfae42a2b115a664b0484b01a235d1d4e266c16 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanay...@canonical.com>
Date: Mon, 16 Apr 2018 17:18:35 +0000
Subject: [PATCH] Log the error that made Daemon.Init() fail

Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
---
 lxd/daemon.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/daemon.go b/lxd/daemon.go
index a045bb339..8c8ef3bfc 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -365,6 +365,7 @@ func (d *Daemon) Init() error {
        // cleanup any state we produced so far. Errors happening here will be
        // ignored.
        if err != nil {
+               logger.Errorf("Failed to start the daemon: %v", err)
                d.Stop()
        }
 
@@ -699,6 +700,7 @@ func (d *Daemon) Kill() {
 
 // Stop stops the shared daemon.
 func (d *Daemon) Stop() error {
+       logger.Info("Starting shutdown sequence")
        errs := []error{}
        trackError := func(err error) {
                if err != nil {
@@ -780,6 +782,9 @@ func (d *Daemon) Stop() error {
                }
                err = fmt.Errorf(format, errs[0])
        }
+       if err != nil {
+               logger.Errorf("Failed to cleanly shutdown daemon: %v", err)
+       }
        return err
 }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to