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

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) ===
Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
From 3e143742198fecb447fbc10a8bd0372ac14a0da2 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanay...@canonical.com>
Date: Tue, 6 Mar 2018 13:05:58 +0000
Subject: [PATCH] Ignore io.EOF errors when performing PUT /internal/shutdown

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

diff --git a/lxd/main_shutdown.go b/lxd/main_shutdown.go
index 675ad647cf..db1f05bb69 100644
--- a/lxd/main_shutdown.go
+++ b/lxd/main_shutdown.go
@@ -2,6 +2,7 @@ package main
 
 import (
        "fmt"
+       "io"
        "time"
 
        "github.com/lxc/lxd/client"
@@ -12,6 +13,13 @@ func cmdShutdown(args *Args) error {
                SkipGetServer: true,
        }
        c, err := lxd.ConnectLXDUnix("", connArgs)
+       if err == io.EOF {
+               // If we got an EOF error here it means that the daemon has
+               // shutdown so quickly that it already closed the unix
+               // socket. We consider this good enough to consider the process
+               // dead.
+               return nil
+       }
        if err != nil {
                return err
        }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to