Skip to content

Commit

Permalink
SYS-1936 add zfs-auto-snap auto killer
Browse files Browse the repository at this point in the history
Hack until we fix the real issue - kill any hourly snapshot process that
has been running for over 15 minutes.
  • Loading branch information
geoffdavis committed Aug 5, 2014
1 parent db36a0d commit bbcbc7a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions files/snaphourlykiller
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

export PATH=/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin

for pid in $(pgrep -f zfs-auto-snapshot); do
if pargs $pid | grep auto-snapshot:hourly > /dev/null ; then
echo Killing stale hourly snapshot process: $pid
ptree $pid
kill $pid
fi
done
15 changes: 15 additions & 0 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@
require => File['/usr/local/sbin'],
}

file { '/usr/local/sbin/snaphourlykiller':
ensure => 'present',
source => 'puppet:///modules/zfsautosnap/snaphourlykiller',
owner => 'root',
group => 'sys',
mode => '0755',
require => File['/usr/local/sbin'],
} ->
cron {'snaphourlykiller':
ensure => 'present',
command => '/usr/local/sbin/snaphourlykiller',
user => 'root',
minute => 15,
}

svcprop { 'zfssnap daily type':
fmri => "${basefmri}:daily",
property => 'zfs/backup',
Expand Down

0 comments on commit bbcbc7a

Please sign in to comment.