The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7568
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 315ed71cd206ebb30d95b6fbe9d3121c431167a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Mon, 22 Jun 2020 15:27:42 -0400 Subject: [PATCH] lxd/vm: Add udev rule fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- lxd/instance/drivers/driver_qemu.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go index 8ebb0fdd41..b76f5f31c8 100644 --- a/lxd/instance/drivers/driver_qemu.go +++ b/lxd/instance/drivers/driver_qemu.go @@ -1341,6 +1341,19 @@ WantedBy=multi-user.target return err } + // Udev rules + err = os.MkdirAll(filepath.Join(configDrivePath, "udev"), 0500) + if err != nil { + return err + } + + lxdAgentRules := `ACTION=="add", SYMLINK=="virtio-ports/org.linuxcontainers.lxd", TAG+="systemd", ACTION=="add", RUN+="/bin/systemctl start lxd-agent.service"` + err = ioutil.WriteFile(filepath.Join(configDrivePath, "udev", "99-lxd-agent.rules"), []byte(lxdAgentRules), 0400) + if err != nil { + return err + } + + // Install script for manual installs. lxdConfigShareInstall := `#!/bin/sh if [ ! -e "systemd" ] || [ ! -e "lxd-agent" ]; then @@ -1353,6 +1366,7 @@ if [ ! -e "/lib/systemd/system" ]; then exit 1 fi +cp udev/99-lxd-agent.rules /lib/udev/rules.d/ cp systemd/lxd-agent.service /lib/systemd/system/ cp systemd/lxd-agent-9p.service /lib/systemd/system/ systemctl daemon-reload
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel