Merge pull request #34 from clns/systemd-restart
Use 'systemctl restart' when restarting instead of stop/start
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func isSystemd() bool {
|
func isSystemd() bool {
|
||||||
@@ -147,12 +146,7 @@ func (s *systemd) Stop() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *systemd) Restart() error {
|
func (s *systemd) Restart() error {
|
||||||
err := s.Stop()
|
return run("systemctl", "restart", s.Name+".service")
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
time.Sleep(50 * time.Millisecond)
|
|
||||||
return s.Start()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const systemdScript = `[Unit]
|
const systemdScript = `[Unit]
|
||||||
|
|||||||
Reference in New Issue
Block a user