[pve-devel] [PATCH 2/2] Add signal handling when we sync.

Wolfgang Link w.link at proxmox.com
Tue Aug 2 12:24:50 CEST 2016


This gives the capability to clean up, if a error occurs.
---
 pve-zsync | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pve-zsync b/pve-zsync
index f40971c..194eabf 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -51,6 +51,11 @@ check_bin ('zfs');
 check_bin ('ssh');
 check_bin ('scp');
 
+$SIG{TERM} = $SIG{QUIT} = $SIG{PIPE} = $SIG{HUP} = $SIG{KILL} = $SIG{INT} =
+    sub {
+	die "Signal aborting sync\n";
+    };
+
 sub check_bin {
     my ($bin)  = @_;
 
-- 
2.1.4





More information about the pve-devel mailing list