Skip to content

Commit

Permalink
Merge pull request #199 from simondeziel/no-upstart-latest-candidate
Browse files Browse the repository at this point in the history
lxd-migrate: remove support for upstart (latest-candidate)
  • Loading branch information
tomponline authored Nov 20, 2023
2 parents 7b326ea + 62e9207 commit a6f1039
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
12 changes: 0 additions & 12 deletions lxd-migrate/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand All @@ -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")
}

Expand All @@ -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")
}

Expand Down
14 changes: 0 additions & 14 deletions lxd-migrate/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "/") {
Expand Down Expand Up @@ -134,10 +124,6 @@ func osInit() string {
fields := strings.Split(initExe, " ")
init := filepath.Base(fields[0])

if init == "init" {
init = "upstart"
}

return init
}

Expand Down

0 comments on commit a6f1039

Please sign in to comment.