From eb72f4c71ca030ef51496524944a7063d5ef650a Mon Sep 17 00:00:00 2001 From: Matteo Suppo Date: Tue, 29 Sep 2015 16:42:40 +0200 Subject: [PATCH] Add logging to find out what's going wrong --- hub.go | 2 ++ trayicon.go | 3 +++ update.go | 2 ++ 3 files changed, 7 insertions(+) diff --git a/hub.go b/hub.go index 022f7f9e3..421989701 100755 --- a/hub.go +++ b/hub.go @@ -197,6 +197,7 @@ func checkCmd(m []byte) { } else if strings.HasPrefix(sl, "broadcast") { go broadcast(s) } else if strings.HasPrefix(sl, "restart") { + log.Println("Received restart from the daemon. Why? Boh") restart("") } else if strings.HasPrefix(sl, "exit") { exit() @@ -266,6 +267,7 @@ func exit() { } func restart(path string) { + log.Println("called restart", path) // relaunch ourself and exit // the relaunch works because we pass a cmdline in // that has serial-port-json-server only initialize 5 seconds later diff --git a/trayicon.go b/trayicon.go index 19fb92b06..4be9c61f7 100644 --- a/trayicon.go +++ b/trayicon.go @@ -55,6 +55,7 @@ func addRebootTrayElement() { <-reboot_tray.ClickedCh systray.Quit() log.Println("Restarting now...") + log.Println("Restart because addReebotTrayElement") restart("") }() } @@ -78,6 +79,7 @@ func setupSysTrayReal() { } systray.Quit() *hibernate = true + log.Println("Restart becayse setup went wrong?") restart("") }() @@ -113,6 +115,7 @@ func setupSysTrayHibernate() { go func() { <-mOpen.ClickedCh *hibernate = false + log.Println("Restart for hubernation") restart("") }() diff --git a/update.go b/update.go index 59f9ae257..e2ffea7b6 100644 --- a/update.go +++ b/update.go @@ -325,6 +325,8 @@ func (u *Updater) update() error { //shutil.CopyFile(*configIni, *configIni+".bak", false) //os.Remove(*configIni) + log.Println("Restarting because update!") + restart(path) //addRebootTrayElement()