diff --git a/lxd-migrate/lxd.go b/lxd-migrate/lxd.go index 3cfe68edc..171e8879d 100644 --- a/lxd-migrate/lxd.go +++ b/lxd-migrate/lxd.go @@ -218,10 +218,6 @@ func (d *lxdDaemon) reload() error { return systemdCtl("reload", "snap.lxd.daemon.service") } - if osInit() == "upstart" { - return upstartCtl("restart", "lxd") - } - return systemdCtl("restart", "lxd.service", "lxd.socket") } @@ -231,10 +227,6 @@ func (d *lxdDaemon) start() error { return systemdCtl("start", "snap.lxd.daemon.service") } - if osInit() == "upstart" { - return upstartCtl("start", "lxd") - } - return systemdCtl("start", "lxd.service", "lxd.socket") } @@ -248,10 +240,6 @@ func (d *lxdDaemon) stop() error { return systemdCtl("stop", "snap.lxd.daemon.service") } - if osInit() == "upstart" { - return upstartCtl("stop", "lxd") - } - return systemdCtl("stop", "lxd.service", "lxd.socket") } diff --git a/lxd-migrate/utils.go b/lxd-migrate/utils.go index 95e9bafa6..4d703c680 100644 --- a/lxd-migrate/utils.go +++ b/lxd-migrate/utils.go @@ -72,16 +72,6 @@ func systemdCtl(action string, units ...string) error { return err } -func upstartCtl(action string, units ...string) error { - args := []string{} - args = append(args, action) - args = append(args, units...) - - // Run initctl - _, err := shared.RunCommand("initctl", args...) - return err -} - func convertPath(path string, src string, dst string) string { // Relative paths are handled by LXD if !strings.HasPrefix(path, "/") { @@ -134,10 +124,6 @@ func osInit() string { fields := strings.Split(initExe, " ") init := filepath.Base(fields[0]) - if init == "init" { - init = "upstart" - } - return init }