Skip to content

Commit

Permalink
Add section about possible cleanup tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Nov 6, 2024
1 parent ef40c6b commit 18c74ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
5 changes: 3 additions & 2 deletions src/main/java/org/cryptomator/cli/Unlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Unlock implements Callable<Integer> {
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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 18c74ab

Please sign in to comment.