From 3c356ae54c8afa8b1010fc2d10eab6c22591c7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=28=E8=80=81=E8=B7=AF=29?= <767898193@qq.com> Date: Wed, 11 Dec 2019 11:17:25 +0800 Subject: [PATCH] Upstart supports the "restart" option (#193) --- service_upstart_linux.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/service_upstart_linux.go b/service_upstart_linux.go index 660357f..be404d9 100644 --- a/service_upstart_linux.go +++ b/service_upstart_linux.go @@ -13,7 +13,6 @@ import ( "strings" "syscall" "text/template" - "time" ) func isUpstart() bool { @@ -225,12 +224,7 @@ func (s *upstart) Stop() error { } func (s *upstart) Restart() error { - err := s.Stop() - if err != nil { - return err - } - time.Sleep(50 * time.Millisecond) - return s.Start() + return run("initctl", "restart", s.Name) } // The upstart script should stop with an INT or the Go runtime will terminate