[oe-commits] [openembedded-core] 13/23: systemd: Add partial support of drop-in configuration files to systemd-systemctl-native

git at git.openembedded.org git at git.openembedded.org
Thu Jul 25 22:03:38 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 0cc86ca93f913ffca4f23f661707c4cc99c7d87c
Author: Frederic Ouellet <fredericouellet at eaton.com>
AuthorDate: Thu Jul 25 15:58:50 2019 -0400

    systemd: Add partial support of drop-in configuration files to systemd-systemctl-native
    
    Support for serive-name.service.d/ folders containing .conf files
    It don't support all the partial folder names
    
    See https://www.freedesktop.org/software/systemd/man/systemd.unit.html
    
    Signed-off-by: Frederic Ouellet <fredericouellet at eaton.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 8d7b3ba..8837f54 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -28,6 +28,10 @@ class SystemdFile():
     def __init__(self, root, path):
         self.sections = dict()
         self._parse(root, path)
+        dirname = os.path.basename(path.name) + ".d"
+        for location in locations:
+            for path2 in sorted((root / location / "system" / dirname).glob("*.conf")):                
+                self._parse(root, path2)
 
     def _parse(self, root, path):
         """Parse a systemd syntax configuration file
@@ -56,8 +60,11 @@ class SystemdFile():
                 line = line.rstrip("\n")
                 m = section_re.match(line)
                 if m:
-                    section = dict()
-                    self.sections[m.group('section')] = section
+                    if m.group('section') not in self.sections:
+                        section = dict()
+                        self.sections[m.group('section')] = section
+                    else:
+                        section = self.sections[m.group('section')]
                     continue
 
                 while line.endswith("\\"):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list