about summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems
diff options
context:
space:
mode:
authorKarmanyaah Malhotra <karmanyaah.gh@malhotra.cc>2023-01-31 11:32:20 -0500
committerKarmanyaah Malhotra <karmanyaah.git@malhotra.cc>2023-04-13 03:14:59 -0500
commit4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805 (patch)
tree83797fa927e7316fcaf1726ce3cc5521c6d9d4e8 /nixos/modules/services/network-filesystems
parent28949db47e56fa276bcc8f25fd9482a8c4eb155e (diff)
downloadnixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar.gz
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar.bz2
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar.lz
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar.xz
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.tar.zst
nixlib-4bd622cd9d17d3fe2dedbc2adcb1eb45ecbff805.zip
nixos/kubo: unmount on service stop
When kubo is force killed with `pkill -KILL ipfs` or by systemd-oomd,
it doesn't unmount /ipfs and /ipns. That prevents it
from starting up the next time. So, unmount on postStop.
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r--nixos/modules/services/network-filesystems/kubo.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/services/network-filesystems/kubo.nix b/nixos/modules/services/network-filesystems/kubo.nix
index 0cb0e126d4c5..e2cc477b23f9 100644
--- a/nixos/modules/services/network-filesystems/kubo.nix
+++ b/nixos/modules/services/network-filesystems/kubo.nix
@@ -319,6 +319,10 @@ in
           # change when the changes are applied. Whyyyyyy.....
           ipfs --offline config replace -
       '';
+      postStop = mkIf cfg.autoMount ''
+        # After an unclean shutdown the fuse mounts at ${cfg.ipnsMountDir} and ${cfg.ipfsMountDir} are locked
+        umount --quiet '${cfg.ipnsMountDir}' '${cfg.ipfsMountDir}' || true
+      '';
       serviceConfig = {
         ExecStart = [ "" "${cfg.package}/bin/ipfs daemon ${kuboFlags}" ];
         User = cfg.user;