From 18c74ab08eec23b1cc603cd4d74494d9995d1243 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 6 Nov 2024 16:32:24 +0100 Subject: [PATCH] Add section about possible cleanup tasks. --- README.md | 12 ++++++++++++ src/main/java/org/cryptomator/cli/Unlock.java | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a834fbd..db1d865 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,18 @@ Mount the vault with: osascript -e 'mount volume "http://localhost:8080/demoVault/"' ``` +## Manual Cleanup + +If a handle to a resource inside the unlocked vault is still open, a graceful unmount is not possible and cryptomator-cli just terminates without executing possible cleanup tasks. +In that case the message "GRACEFUL UNMOUNT FAILED" is printed to the console/stdout. + +On a linux OS with the `LinuxFuseMountProvider`, the manual cleanup task is to unmount and free the mountpoint: +``` +fusermount -u /path/to/former/mountpoint +``` + +For other OSs, there is no cleanup necessary. + ## License This project is dual-licensed under the AGPLv3 for FOSS projects as well as a commercial license derived from the LGPL for independent software vendors and resellers. If you want to use this library in applications, that are *not* licensed under the AGPL, feel free to contact our [support team](https://cryptomator.org/help/). diff --git a/src/main/java/org/cryptomator/cli/Unlock.java b/src/main/java/org/cryptomator/cli/Unlock.java index 6ab38ba..f769123 100644 --- a/src/main/java/org/cryptomator/cli/Unlock.java +++ b/src/main/java/org/cryptomator/cli/Unlock.java @@ -39,6 +39,7 @@ public class Unlock implements Callable { private static final byte[] PEPPER = new byte[0]; private static final String CONFIG_FILE_NAME = "vault.cryptomator"; private static final String MASTERKEY_FILE_NAME = "masterkey.cryptomator"; + private static final String FORCED_UNMOUNT_MSG = "GRACEFUL UNMOUNT FAILED. Please check if manual cleanups are necessary"; @Spec Model.CommandSpec spec; @@ -86,7 +87,7 @@ public Integer call() throws Exception { Runtime.getRuntime().addShutdownHook(new Thread(() -> teardown(mount))); Thread.currentThread().join(); } catch (UnmountFailedException e) { - LOG.error("Regular unmount failed. Just terminating process...", e); + LOG.error(FORCED_UNMOUNT_MSG, e); } return 0; } @@ -95,7 +96,7 @@ private void teardown(Mount m) { try { m.close(); } catch (IOException | UnmountFailedException e) { - LOG.error("Graceful unmount failed, possible cleanup not executed.", e); + LOG.error(FORCED_UNMOUNT_MSG, e); } }