From b217ad5732f0936051d5faf6083b4da45ed47c57 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Thu, 18 May 2017 14:44:51 +1000 Subject: [PATCH] Bounce the syslog service so it notices the hostname change Signed-off-by: Sven Dowideit --- cmd/network/network.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/network/network.go b/cmd/network/network.go index e6b40713..91f1d21a 100755 --- a/cmd/network/network.go +++ b/cmd/network/network.go @@ -1,6 +1,9 @@ package network import ( + "golang.org/x/net/context" + + "github.com/rancher/os/docker" "github.com/rancher/os/log" "github.com/docker/libnetwork/resolvconf" @@ -15,6 +18,16 @@ func Main() { cfg := config.LoadConfig() ApplyNetworkConfig(cfg) + log.Infof("Restart syslog") + client, err := docker.NewSystemClient() + if err != nil { + log.Error(err) + } + + if err := client.ContainerRestart(context.Background(), "syslog", 10); err != nil { + log.Error(err) + } + select {} }