diff --git a/supervisor/__main__.py b/supervisor/__main__.py index 806292940..2db75bd8d 100644 --- a/supervisor/__main__.py +++ b/supervisor/__main__.py @@ -30,8 +30,7 @@ if __name__ == "__main__": loop = initialize_event_loop() # Check if all information are available to setup Supervisor - if not bootstrap.check_environment(): - sys.exit(1) + bootstrap.check_environment() # init executor pool executor = ThreadPoolExecutor(thread_name_prefix="SyncWorker") diff --git a/supervisor/bootstrap.py b/supervisor/bootstrap.py index b70b81f4f..1c467a246 100644 --- a/supervisor/bootstrap.py +++ b/supervisor/bootstrap.py @@ -197,7 +197,7 @@ def initialize_logging(): ) -def check_environment(): +def check_environment() -> None: """Check if all environment are exists.""" # check environment variables for key in (ENV_SHARE, ENV_NAME, ENV_REPO): @@ -205,24 +205,18 @@ def check_environment(): os.environ[key] except KeyError: _LOGGER.fatal("Can't find %s in env!", key) - return False # check docker socket if not SOCKET_DOCKER.is_socket(): _LOGGER.fatal("Can't find Docker socket!") - return False # check socat exec if not shutil.which("socat"): _LOGGER.fatal("Can't find socat!") - return False # check socat exec if not shutil.which("gdbus"): _LOGGER.fatal("Can't find gdbus!") - return False - - return True def reg_signal(loop): diff --git a/supervisor/const.py b/supervisor/const.py index 9491ecf51..3f36e54ff 100644 --- a/supervisor/const.py +++ b/supervisor/const.py @@ -28,7 +28,7 @@ FILE_HASSIO_INGRESS = Path(SUPERVISOR_DATA, "ingress.json") FILE_HASSIO_DNS = Path(SUPERVISOR_DATA, "dns.json") FILE_HASSIO_AUDIO = Path(SUPERVISOR_DATA, "audio.json") -SOCKET_DOCKER = Path("/var/run/docker.sock") +SOCKET_DOCKER = Path("/run/docker.sock") DOCKER_NETWORK = "hassio" DOCKER_NETWORK_MASK = ip_network("172.30.32.0/23")