async def get_best_controller_implementation(config: KresConfig) -> SubprocessController:
- logger.debug("Starting service manager auto-selection...")
+ logger.info("Starting service manager auto-selection...")
if len(_registered_controllers) == 0:
logger.error("No controllers are available! Did you install all dependencies?")
# check all controllers concurrently
res = await asyncio.gather(*(cont.is_controller_available(config) for cont in _registered_controllers))
+ logger.info(
+ "Available subprocess controllers are %s",
+ str(tuple((str(c) for r, c in zip(res, _registered_controllers) if r))),
+ )
# take the first one on the list which is available
for avail, controller in zip(res, _registered_controllers):
cmd = f"systemctl {'--user' if self._systemd_type == SystemdType.SESSION else ''} status"
ret = await call(cmd, shell=True, discard_output=True)
if ret != 0:
- logger.info(
+ logger.debug(
"Calling '%s' failed. Assumming systemd (%s) is not running/installed.", cmd, self._systemd_type
)
return False
# check that we run under root for non-session systemd
try:
if self._systemd_type is SystemdType.SYSTEM and os.geteuid() != 0:
- logger.info(
+ logger.debug(
"Systemd (%s) looks functional, but we are not running as root. Assuming not enough privileges",
self._systemd_type,
)
return True
except BaseException: # we want every possible exception to be caught
- logger.warning("Communicating with systemd DBus API failed", exc_info=True)
+ logger.warning("Systemd autodetection error: communicating with systemd DBus API failed", exc_info=True)
return False
async def get_all_running_instances(self) -> Iterable[Subprocess]: