[lxc-devel] [distrobuilder/master] generators/lxd-agent: Fix systemd unit files

monstermunchkin on Github lxc-bot at linuxcontainers.org
Tue Feb 18 21:01:04 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 439 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200218/d6ebecb3/attachment.bin>
-------------- next part --------------
From 0356b903b888be922ebcad55c97692364e6b2618 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Tue, 18 Feb 2020 22:00:11 +0100
Subject: [PATCH] generators/lxd-agent: Fix systemd unit files

This fixes the location of the unit files as well as their permissions.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 generators/lxd-agent.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/generators/lxd-agent.go b/generators/lxd-agent.go
index 6ba78d11..cd861eb5 100644
--- a/generators/lxd-agent.go
+++ b/generators/lxd-agent.go
@@ -79,7 +79,7 @@ ExecStart=/run/lxd_config/9p/lxd-agent
 WantedBy=multi-user.target
 `
 
-	err := ioutil.WriteFile(filepath.Join(sourceDir, "/lib/systemd/lxd-agent.service"), []byte(lxdAgentServiceUnit), 0400)
+	err := ioutil.WriteFile(filepath.Join(sourceDir, "/lib/systemd/system/lxd-agent.service"), []byte(lxdAgentServiceUnit), 0644)
 	if err != nil {
 		return err
 	}
@@ -106,7 +106,7 @@ ExecStart=/bin/mount -t 9p config /run/lxd_config/9p -o access=0
 WantedBy=multi-user.target
 `
 
-	err = ioutil.WriteFile(filepath.Join(sourceDir, "/lib/systemd/lxd-agent-9p.service"), []byte(lxdConfigShareMountUnit), 0400)
+	err = ioutil.WriteFile(filepath.Join(sourceDir, "/lib/systemd/system/lxd-agent-9p.service"), []byte(lxdConfigShareMountUnit), 0644)
 	if err != nil {
 		return err
 	}


More information about the lxc-devel mailing list