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"
|
||||
"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]
|
||||
|
||||
Reference in New Issue
Block a user