Browse Source

docker: unmount on SIGTERM (previously signal was ignored)

Fabian Peter Hammerle 5 năm trước cách đây
mục cha
commit
16fb3f04f9
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      docker/rgpgfs_unattended.sh

+ 3 - 1
docker/rgpgfs_unattended.sh

@@ -38,7 +38,9 @@ set -x
 grep -q "^trust-model always$" ~/.gnupg/gpg.conf 2> /dev/null \
     || echo trust-model always | tee ~/.gnupg/gpg.conf
 
+trap 'fusermount3 -u "$CIPHER_DIR"' SIGTERM
 rgpgfs -f -o allow_other \
     -o modules=subdir,subdir="$SOURCE_DIR" \
     -o recipient="$RECIPIENT" \
-    "$CIPHER_DIR"
+    "$CIPHER_DIR" &
+wait $!