The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/348

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) ===

From 6100c6662f26c2cd72203b73de0fe078663cf527 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Mon, 22 Jun 2020 15:36:50 -0400
Subject: [PATCH 1/2] lxd-agent: Update units
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 generators/lxd-agent.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generators/lxd-agent.go b/generators/lxd-agent.go
index 93b47be..1491bd0 100644
--- a/generators/lxd-agent.go
+++ b/generators/lxd-agent.go
@@ -72,7 +72,7 @@ Before=cloud-init.target cloud-init.service 
cloud-init-local.service
 DefaultDependencies=no
 
 [Service]
-Type=simple
+Type=notify
 WorkingDirectory=/run/lxd_config/9p
 ExecStart=/run/lxd_config/9p/lxd-agent
 Restart=on-failure

From 85ddc5429a47909535921c0407f9cbf391c2bec3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Mon, 22 Jun 2020 15:36:57 -0400
Subject: [PATCH 2/2] lxd-agent: Add udev rules
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 generators/lxd-agent.go | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/generators/lxd-agent.go b/generators/lxd-agent.go
index 1491bd0..251ff05 100644
--- a/generators/lxd-agent.go
+++ b/generators/lxd-agent.go
@@ -85,7 +85,6 @@ WantedBy=multi-user.target
 `
 
        systemdPath := filepath.Join("/", "lib", "systemd", "system")
-
        if !lxd.PathExists(filepath.Dir(filepath.Join(sourceDir, systemdPath))) 
{
                systemdPath = filepath.Join("/", "usr", "lib", "systemd", 
"system")
        }
@@ -129,6 +128,17 @@ WantedBy=multi-user.target
                return err
        }
 
+       udevPath := filepath.Join("/", "lib", "udev", "rules.d")
+       if !lxd.PathExists(filepath.Dir(filepath.Join(sourceDir, udevPath))) {
+               udevPath = filepath.Join("/", "usr", "lib", "udev", "rules.d")
+       }
+
+       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(sourceDir, udevPath, 
"99-lxd-agent.rules"), []byte(lxdAgentRules), 0400)
+       if err != nil {
+               return err
+       }
+
        return nil
 }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to