]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
container: Add some additional logging
authorAlessandro Astone <ales.astone@gmail.com>
Sun, 24 Aug 2025 14:54:23 +0000 (16:54 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Sun, 24 Aug 2025 15:01:01 +0000 (17:01 +0200)
Now that only the container manager can write to the log file, traces that were
previously being written by other commands no longer appear in the log file.

Add some logging to the session handling so that we still see these traces in
the log file.

tools/actions/container_manager.py

index 3ce85b3f4ff48c01417aa1e84f4e3d007bd337ea..b14dd63ae46983df9eb70b6c87c64739c0f0bb39 100644 (file)
@@ -132,6 +132,8 @@ def do_start(args, session):
     if "session" in args:
         raise RuntimeError("Already tracking a session")
 
     if "session" in args:
         raise RuntimeError("Already tracking a session")
 
+    logging.info("Starting up container for a new session")
+
     # Networking
     command = [tools.config.tools_src +
                "/data/scripts/waydroid-net.sh", "start"]
     # Networking
     command = [tools.config.tools_src +
                "/data/scripts/waydroid-net.sh", "start"]
@@ -192,6 +194,8 @@ def do_start(args, session):
     args.session = session
 
 def stop(args, quit_session=True):
     args.session = session
 
 def stop(args, quit_session=True):
+    logging.info("Stopping container")
+
     try:
         services.hardware_manager.stop(args)
         status = helpers.lxc.status(args)
     try:
         services.hardware_manager.stop(args)
         status = helpers.lxc.status(args)
@@ -232,6 +236,7 @@ def stop(args, quit_session=True):
 
         if "session" in args:
             if quit_session:
 
         if "session" in args:
             if quit_session:
+                logging.info("Terminating session because the container was stopped")
                 try:
                     os.kill(int(args.session["pid"]), signal.SIGUSR1)
                 except:
                 try:
                     os.kill(int(args.session["pid"]), signal.SIGUSR1)
                 except: