So I run Insync on Linux (Ubuntu 21.04) and ZFS, and I had an issue today that scared the hell out of me. Due to a failed drive my ZFS pool didn’t come up, and when Insync started it interpreted the missing data as “He went and deleted everything” and proceeded to delete everything from the cloud. Now thankfully that is something easily fixed, but I have to know if there is an easy way to tell Insync not to start if it doesn’t see the filesystem actually MOUNTED.
For my purposes I’ve changed the auto-start to refer to a script that looks for my data mountpoints before starting it, but feel like that’s a kludgy work-around that could be fixed more eqoquently in the code itself.
For the record (in case anyone needs it) I changed /usr/bin/insync to include the following:
#!/bin/bash
zfs list | grep DataPool > /dev/null ; rc=$?
while [ "${rc}" != "0" ] ; do
echo "Waiting for ZFS"
sleep 10
zfs list | grep DataPool > /dev/null ; rc=$?
done
LC_TIME=C exec /usr/lib/insync/insync "$@"