private boolean shouldBeActive() { if(!System.getProperty("os.name").equals("SunOS") || disabled) // on systems that don't have ZFS, we don't need this monitor return false; try { List<NativeZfsFileSystem> roots = nativeUtils.getZfsRoots(); if(roots.isEmpty()) return false; // no active ZFS pool // if we don't run on a ZFS file system, activate NativeZfsFileSystem hudsonZfs = nativeUtils.getZfsByMountPoint(Hudson.getInstance().getRootDir()); if(hudsonZfs!=null) return false; // already on ZFS // decide what file system we'll create NativeZfsFileSystem pool = roots.get(0); prospectiveZfsFileSystemName = computeHudsonFileSystemName(pool); return true; } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to detect whether Hudson is on ZFS",e); return false; } catch (LinkageError e) { LOGGER.info("No ZFS available. If you believe this is an error, increase the logging level to get the stack trace"); LOGGER.log(Level.FINE,"Stack trace of failed ZFS load",e); return false; } }
return existing.getName(); List<NativeZfsFileSystem> roots = nativeUtils.getZfsRoots(); String name = computeHudsonFileSystemName(roots.get(0)); out.println("Creating " + name);