diff mbox series

[master,scarthgap,kirkstone] systemd-systemctl: Add extra log for easy of debugging

Message ID 20240515094523.93410-1-ranjitsinhrathod1991@gmail.com
State Awaiting Upstream
Delegated to: Steve Sakoman
Headers show
Series [master,scarthgap,kirkstone] systemd-systemctl: Add extra log for easy of debugging | expand

Commit Message

Ranjitsinh Rathod May 15, 2024, 9:45 a.m. UTC
From: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>

Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
Signed-off-by: Ranjitsinh Rathod <ranjitsinhrathod1991@gmail.com>
---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 2229bc7b6d..4389556910 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -31,6 +31,7 @@  class SystemdFile():
 
     def __init__(self, root, path, instance_unit_name):
         self.sections = dict()
+        print(f"Parsing unit: {path}", file=sys.stderr)
         self._parse(root, path)
         dirname = os.path.basename(path.name) + ".d"
         for location in locations:
@@ -39,6 +40,7 @@  class SystemdFile():
                 inst_dirname = instance_unit_name + ".d"
                 files = chain(files, (root / location / "system" / inst_dirname).glob("*.conf"))
             for path2 in sorted(files):
+                print(f"Parsing unit's override: {path2}", file=sys.stderr)
                 self._parse(root, path2)
 
     def _parse(self, root, path):
@@ -88,6 +90,11 @@  class SystemdFile():
                 # forget all preceding assignments. This works because we are
                 # processing files in correct parse order.
                 if k in self._clearable_keys and not v:
+                    print(
+                        f"The directive '{k}' is empty, therefore the values '{section[k]}' "
+                        "are going to be discarded",
+                        file=sys.stderr,
+                    )
                     del section[k]
                     continue