Merge pull request #34 from clns/systemd-restart

Use 'systemctl restart' when restarting instead of stop/start
This commit is contained in:
Daniel Theophanes
2015-10-22 09:11:19 -07:00
+1 -7
View File
@@ -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]