diff --git a/backend/services/zfs_runner.py b/backend/services/zfs_runner.py index 189e507..7ea7ea9 100644 --- a/backend/services/zfs_runner.py +++ b/backend/services/zfs_runner.py @@ -16,8 +16,17 @@ import re logger = logging.getLogger(__name__) # Detect ZFS availability once at import time — avoids repeated ERROR logs on LXC/non-ZFS systems -import shutil as _shutil -ZFS_AVAILABLE = bool(_shutil.which("zpool")) +# shutil.which is not enough: on privileged LXC containers zpool exists but /dev/zfs is missing +def _probe_zfs() -> bool: + try: + r = subprocess.run(["zpool", "list"], capture_output=True, timeout=3) + return r.returncode == 0 + except (FileNotFoundError, subprocess.TimeoutExpired, OSError): + return False + +ZFS_AVAILABLE = _probe_zfs() +if not ZFS_AVAILABLE: + logger.info("ZFS not available on this system (pools/snapshots disabled)") # Cache with TTL @dataclass