From a417477c4324d7f246c25900059198d458ee64a1 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 10 Dec 2012 12:50:38 +0100 Subject: [PATCH] implement afterfork callback --- Makefile | 2 +- data/PVE/Tools.pm | 5 +++++ debian/changelog | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 12ee988..d477f33 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ RELEASE=2.2 VERSION=1.0 -PKGREL=39 +PKGREL=40 PACKAGE=libpve-common-perl diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index 3212595..20fc1ea 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -236,6 +236,7 @@ sub run_command { my $logfunc; my $input; my $output; + my $afterfork; eval { @@ -256,6 +257,8 @@ sub run_command { $errfunc = $param{$p}; } elsif ($p eq 'logfunc') { $logfunc = $param{$p}; + } elsif ($p eq 'afterfork') { + $afterfork = $param{$p}; } else { die "got unknown parameter '$p' for run_command\n"; } @@ -316,6 +319,8 @@ sub run_command { local $SIG{ALRM} = sub { die "got timeout\n"; } if $timeout; $oldtimeout = alarm($timeout) if $timeout; + &$afterfork() if $afterfork; + if (ref($writer)) { print $writer $input if defined $input; close $writer; diff --git a/debian/changelog b/debian/changelog index 225344f..ad9b356 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libpve-common-perl (1.0-40) unstable; urgency=low + + * run_command: implement afterfork callback + + -- Proxmox Support Team Mon, 10 Dec 2012 12:50:12 +0100 + libpve-common-perl (1.0-39) unstable; urgency=low * remove hardcoded blowfish cipher -- 2.39.2