X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/ff4cf1c83f09e639504209dec68855cdf3c69bce..2c223d412e8dfcb89efaf715f1e1f657a8c7e509:/tools/actions/container_manager.py diff --git a/tools/actions/container_manager.py b/tools/actions/container_manager.py index e36cfbf..cbd6298 100644 --- a/tools/actions/container_manager.py +++ b/tools/actions/container_manager.py @@ -123,10 +123,7 @@ def start(args): def do_start(args, session): if "session" in args: - logging.info("Already tracking a session") - return - - args.session = session + raise RuntimeError("Already tracking a session") # Networking command = [tools.config.tools_src + @@ -140,12 +137,12 @@ def do_start(args, session): # Mount rootfs cfg = tools.config.load(args) - helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], args.session) + helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], session) helpers.protocol.set_aidl_version(args) # Mount data - helpers.mount.bind(args, args.session["waydroid_data"], + helpers.mount.bind(args, session["waydroid_data"], tools.config.defaults["data"]) # Cgroup hacks @@ -165,19 +162,10 @@ def do_start(args, session): set_permissions(args) helpers.lxc.start(args) - lxc_status = helpers.lxc.status(args) - timeout = 10 - while lxc_status != "RUNNING" and timeout > 0: - lxc_status = helpers.lxc.status(args) - logging.info( - "waiting {} seconds for container to start...".format(timeout)) - timeout = timeout - 1 - time.sleep(1) - if lxc_status != "RUNNING": - raise OSError("container failed to start") - services.hardware_manager.start(args) + args.session = session + def stop(args): try: services.hardware_manager.stop(args)