diff --git a/ubo_app/system/bootstrap.py b/ubo_app/system/bootstrap.py index 1d51e205..d57fe1b7 100644 --- a/ubo_app/system/bootstrap.py +++ b/ubo_app/system/bootstrap.py @@ -223,6 +223,11 @@ def bootstrap(*, with_docker: bool = False, for_packer: bool = False) -> None: check=True, ) + subprocess.run( + ['/usr/bin/env', 'systemctl', 'disable', 'userconfig'], # noqa: S603 + check=True, + ) + reload_daemon() enable_services() diff --git a/ubo_app/system/system_manager/service_manager.py b/ubo_app/system/system_manager/service_manager.py index 0b6df1aa..eefbae5f 100644 --- a/ubo_app/system/system_manager/service_manager.py +++ b/ubo_app/system/system_manager/service_manager.py @@ -80,11 +80,14 @@ def lightdm_handler(command: str) -> None: def system_handler(service: str, command: str) -> str | None: """Interact with system services.""" logger = get_logger('system-manager') - try: - if service == 'ssh': + if service == 'ssh': + try: return ssh_handler(command) - if service == 'lightdm': + except Exception: + logger.exception('Failed to handle SSH command.') + if service == 'lightdm': + try: return lightdm_handler(command) - except Exception: - logger.exception('Failed to handle SSH command.') + except Exception: + logger.exception('Failed to handle LightDM command.') return None