Stop referring to lxd by full path

We now want to be able to switch tremplin between using different lxd
binaries via env variables, so just use "lxd" and let path resolution
take care of things.

BUG=chromium:1097610
TEST=CQ

Disallow-Recycled-Builds: test-failures
Change-Id: I86ee44e5e07f230b57f4b4da142a2be79fbca32e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tremplin/+/2814196
Reviewed-by: Nicholas Verne <nverne@chromium.org>
Reviewed-by: David Munro <davidmunro@google.com>
Tested-by: Fergus Dall <sidereal@google.com>
Commit-Queue: Fergus Dall <sidereal@google.com>
diff --git a/src/chromiumos/tremplin/lxd_helper.go b/src/chromiumos/tremplin/lxd_helper.go
index b84532d..eafe1ec 100644
--- a/src/chromiumos/tremplin/lxd_helper.go
+++ b/src/chromiumos/tremplin/lxd_helper.go
@@ -25,7 +25,7 @@
 	crashHostPort = "7779"
 )
 
-var lxdCmd = []string{"/usr/sbin/lxd", "--group", "lxd", "--syslog"}
+var lxdCmd = []string{"lxd", "--group", "lxd", "--syslog"}
 
 type lxdHelper struct {
 	process        *os.Process
diff --git a/src/chromiumos/tremplin/start_lxd.go b/src/chromiumos/tremplin/start_lxd.go
index 0b743cd..8c81090 100644
--- a/src/chromiumos/tremplin/start_lxd.go
+++ b/src/chromiumos/tremplin/start_lxd.go
@@ -672,7 +672,7 @@
 		}
 		f.Close()
 	}
-	out, err := execCommand("/usr/sbin/lxd", "import", "--force", name)
+	out, err := execCommand("lxd", "import", "--force", name)
 	if err != nil {
 		return fmt.Errorf("Error importing container. Stdout/err: %s. Error: %w", out, err)
 	}
diff --git a/src/chromiumos/tremplin/stop_lxd.go b/src/chromiumos/tremplin/stop_lxd.go
index 6fac629..6d71237 100644
--- a/src/chromiumos/tremplin/stop_lxd.go
+++ b/src/chromiumos/tremplin/stop_lxd.go
@@ -17,7 +17,8 @@
 // findLxdProcesses searches for any running LXD daemons by looking at
 // the executable being run, which is symlinked at /proc/PID/exe, and
 // the commandline at /proc/PID/cmdline. For LXD this will be
-// /usr/sbin/lxd and {"/usr/sbin/lxd", "--group", "lxd", "--syslog"}.
+// /usr/sbin/lxd or /opt/google/lxd-next/usr/bin/lxd and
+// {"lxd", "--group", "lxd", "--syslog"}.
 func findLxdProcesses() []int {
 	fileinfos, _ := ioutil.ReadDir("/proc")
 
@@ -45,7 +46,7 @@
 			// Readlink can return an error.
 			continue
 		}
-		if dest != "/usr/sbin/lxd" {
+		if dest != "/usr/sbin/lxd" && dest != "/opt/google/lxd-next/usr/bin/lxd" {
 			continue
 		}
 		procCmdline, err := ioutil.ReadFile("/proc/" + file.Name() + "/cmdline")