X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/1f0393876d891d0e32a995d0bf7259cc6505afdc..bf567ae4e575924983f12353a414d4ce19fe5fa2:/tools/actions/container_manager.py diff --git a/tools/actions/container_manager.py b/tools/actions/container_manager.py index 994dcea..ce04180 100644 --- a/tools/actions/container_manager.py +++ b/tools/actions/container_manager.py @@ -126,7 +126,7 @@ def start(args): # Sensors tools.helpers.run.root( - args, ["waydroid-sensord", args.HWBINDER_DRIVER], output="background") + args, ["waydroid-sensord", "/dev/" + args.HWBINDER_DRIVER], output="background") # Mount rootfs helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"]) @@ -151,6 +151,15 @@ def start(args): helpers.lxc.start(args) session_cfg["session"]["state"] = helpers.lxc.status(args) + timeout = 10 + while session_cfg["session"]["state"] != "RUNNING" and timeout > 0: + session_cfg["session"]["state"] = helpers.lxc.status(args) + logging.info( + "waiting {} seconds for container to start...".format(timeout)) + timeout = timeout - 1 + time.sleep(1) + if session_cfg["session"]["state"] != "RUNNING": + raise OSError("container failed to start") tools.config.save_session(session_cfg) if not hasattr(args, 'hardwareLoop'): @@ -198,7 +207,7 @@ def stop(args): command = ["pidof", "waydroid-sensord"] pid = tools.helpers.run.root(args, command, check=False, output_return=True) if pid: - command = ["killall", pid] + command = ["kill", "-9", pid] tools.helpers.run.root(args, command, check=False) else: