jimsalterjrs / sanoid

These are policy-driven snapshot management and replication tools which use OpenZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.)
http://www.openoid.net/products/
GNU General Public License v3.0
3.14k stars 308 forks source link

ERROR: No valid lockfile found when running --monitor in cronjob #958

Open neilbags opened 1 month ago

neilbags commented 1 month ago

I''ve got a cronjob that looks like this: @hourly /usr/sbin/sanoid --monitor-snapshots | grep -vE '^OK' @hourly /usr/sbin/sanoid --monitor-health | grep -vE '^OK'

I'm occasionally seeing it error out:

Use of uninitialized value $checkmutex in scalar chomp at /usr/sbin/sanoid line 1488.
Use of uninitialized value $checkmutex in string eq at /usr/sbin/sanoid line 1490.
ERROR: No valid lockfile found - Did a rogue process or user update or delete it?

This is a laptop system that isn't always on. This seems to correspond to reboots or suspend maybe?. Maybe its clashing with the sanoid systemd timer? Or the two cron jobs are are trying to run simultaneously?

Is there a preferred way to do this that won't cause this error? Apologies if I've missed something obvious, I'm a brand new sanoid user (3 days) and loving the ergonomics of it so far. Well done devs!