Upstart supports the "restart" option (#193)

This commit is contained in:
Dean(老路)
2019-12-11 11:17:25 +08:00
committed by Daniel Theophanes
parent 7c2e4f75a4
commit 3c356ae54c
+1 -7
View File
@@ -13,7 +13,6 @@ import (
"strings" "strings"
"syscall" "syscall"
"text/template" "text/template"
"time"
) )
func isUpstart() bool { func isUpstart() bool {
@@ -225,12 +224,7 @@ func (s *upstart) Stop() error {
} }
func (s *upstart) Restart() error { func (s *upstart) Restart() error {
err := s.Stop() return run("initctl", "restart", s.Name)
if err != nil {
return err
}
time.Sleep(50 * time.Millisecond)
return s.Start()
} }
// The upstart script should stop with an INT or the Go runtime will terminate // The upstart script should stop with an INT or the Go runtime will terminate