The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6457
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 b2d7c4855d9dbc6cb712ded7cadebd926859fbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Thu, 14 Nov 2019 08:02:27 -0800 Subject: [PATCH] lxd/vm: Add install script in 9p 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/vm_qemu.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lxd/vm_qemu.go b/lxd/vm_qemu.go index 8fa3b683b3..bc146d5312 100644 --- a/lxd/vm_qemu.go +++ b/lxd/vm_qemu.go @@ -764,6 +764,34 @@ WantedBy=multi-user.target return err } + // Install script for manual installs. + lxdConfigShareInstall := `#!/bin/sh +set -eux +if [ ! -e "systemd" ] || [ ! -e "lxd-agent" ]; then + echo "This script must be run from within the 9p mount" + exit 1 +fi + +if [ ! -e "/lib/systemd/system" ]; then + echo "This script only works on systemd systems" + exit 1 +fi + +cp systemd/lxd-agent.service /lib/systemd/system/ +cp systemd/run-lxd_config.mount /lib/systemd/system/ +systemctl daemon-reload +systemctl enable run-lxd_config.mount lxd-agent.service + +mkdir -p /run/lxd_config +mount -o bind . /run/lxd_config +systemctl start run-lxd_config.mount lxd-agent.service +` + + err = ioutil.WriteFile(filepath.Join(configDrivePath, "install.sh"), []byte(lxdConfigShareInstall), 0700) + if err != nil { + return err + } + return nil }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel