From 86948c68a78ab21b59e1dafeb1d32b9bfef5c6a2 Mon Sep 17 00:00:00 2001 From: Calin Seciu Date: Thu, 22 Oct 2015 02:15:48 +0300 Subject: [PATCH] Use 'systemctl restart' when restarting instead of stop/start --- service_systemd_linux.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/service_systemd_linux.go b/service_systemd_linux.go index cbcf787..77371d1 100644 --- a/service_systemd_linux.go +++ b/service_systemd_linux.go @@ -11,7 +11,6 @@ import ( "os/signal" "syscall" "text/template" - "time" ) func isSystemd() bool { @@ -147,12 +146,7 @@ func (s *systemd) Stop() error { } func (s *systemd) Restart() error { - err := s.Stop() - if err != nil { - return err - } - time.Sleep(50 * time.Millisecond) - return s.Start() + return run("systemctl", "restart", s.Name+".service") } const systemdScript = `[Unit]