From: Alan J. Pippin Date: Fri, 22 Aug 2008 13:34:29 +0000 (-0600) Subject: Changed cleanup() trap to be based on INT signal instead of EXIT X-Git-Url: http://git.pippins.net/embedvideo/.git/%22%22.%24thumbnail.%22/%7Blink_visit%7D?a=commitdiff_plain;h=9457c55171da10869ad028068935418208a576b0;p=zfs-ubuntu%2F.git Changed cleanup() trap to be based on INT signal instead of EXIT to prevent subsequent script instantiations from affecting the any that are currently running if they can't obtain the lock in a timely manner. --- diff --git a/zfs-replicate-wrapper b/zfs-replicate-wrapper index b52e64e..5e4e44a 100755 --- a/zfs-replicate-wrapper +++ b/zfs-replicate-wrapper @@ -24,8 +24,9 @@ cleanup() { /usr/local/etc/bin/usb-drive-power off echo `date` ZFS admin lock released >> $logfile fi + exit } -trap cleanup EXIT +trap cleanup INT # Auto snapshot every zfs filesystem on the system specified below echo "$date Polling for ZFS admin lock" >> $logfile @@ -81,3 +82,6 @@ echo `date` ZFS admin lock released >> $logfile # Parse the log file and extract our backup stats $logfile_parser "$logfile" "$date" >> $logfile +# clean things up and exit +cleanup +