Upstart supports the "restart" option (#193)
This commit is contained in:
committed by
Daniel Theophanes
parent
7c2e4f75a4
commit
3c356ae54c
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user