[elbe-devel] [PATCH] elbepack: daemon: start all subdaemons

Thomas Weißschuh thomas.weissschuh at linutronix.de
Thu Mar 14 07:52:24 CET 2024


The opt-in behavior is not useful as all daemons would be started from
the initscript anyways.
It only leads to problems during development as the initscript won't be
adapted by 'initvm create --devel'.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 debian/python3-elbe-daemon.default |  2 +-
 elbepack/commands/daemon.py        | 29 ++++++++---------------------
 2 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/debian/python3-elbe-daemon.default b/debian/python3-elbe-daemon.default
index bc6948ac63d1..46e3e738f420 100644
--- a/debian/python3-elbe-daemon.default
+++ b/debian/python3-elbe-daemon.default
@@ -1,3 +1,3 @@
 # elbe daemon configuration
 
-DAEMON_ARGS="daemon --port=7588 --soap --repo"
+DAEMON_ARGS="daemon --port=7588"
diff --git a/elbepack/commands/daemon.py b/elbepack/commands/daemon.py
index 9c767ca5a995..edcfbf168d77 100644
--- a/elbepack/commands/daemon.py
+++ b/elbepack/commands/daemon.py
@@ -28,32 +28,19 @@ def run_command(argv):
                        help='port to host daemon')
 
     for d in daemons:
-        oparser.add_option('--' + str(d), dest=str(d), default=False,
+        # unused, compatibility with old initscripts
+        oparser.add_option('--' + str(d), dest='_ignored', default=False,
                            action='store_true', help='enable ' + str(d))
 
     (opt, _) = oparser.parse_args(argv)
 
-    active = False
-
     for d in daemons:
-        for o in dir(opt):
-            if str(o) == str(d):
-                if getattr(opt, o):
-                    active = True
-                    print(f'enable {d}')
-                    module = 'elbepack.daemons.' + str(d)
-                    _ = __import__(module)
-                    cmdmod = sys.modules[module]
-                    cherrypy.tree.graft(
-                        cmdmod.get_app(
-                            cherrypy.engine),
-                        '/' + str(d))
-    if not active:
-        print('no daemon activated, use')
-        for d in daemons:
-            print(f'   --{d}')
-        print('to activate at least one daemon')
-        return
+        print(f'enable {d}')
+        module = 'elbepack.daemons.' + str(d)
+        _ = __import__(module)
+        cmdmod = sys.modules[module]
+        cherrypy.tree.graft(
+            cmdmod.get_app(cherrypy.engine), '/' + str(d))
 
     cherrypy.server.unsubscribe()
     server = cherrypy._cpserver.Server()

---
base-commit: ef9eeca734b372faba47b88df94950d5b465751d
change-id: 20240314-daemon-21b310389c64

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list