]> git.proxmox.com Git - pve-common.git/commitdiff
implement afterfork callback
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 10 Dec 2012 11:50:38 +0000 (12:50 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 10 Dec 2012 11:50:38 +0000 (12:50 +0100)
Makefile
data/PVE/Tools.pm
debian/changelog

index 12ee9889dffdcd927035e94c99d16fb59949c424..d477f33dbd70c86c14f65afda085e2ebab105d99 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.2
 
 VERSION=1.0
-PKGREL=39
+PKGREL=40
 
 PACKAGE=libpve-common-perl
 
index 3212595fdd8306021d0fa30ceb6b87d72ff93413..20fc1ea3ad0f73c1ee4f03b8d6b93586833b6e5b 100644 (file)
@@ -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;
index 225344f2980d9a8ae8f44649bf910cb89244f35f..ad9b356018b929f7cb54b39241d6d8f721163066 100644 (file)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-40) unstable; urgency=low
+
+  * run_command: implement afterfork callback
+
+ -- Proxmox Support Team <support@proxmox.com>  Mon, 10 Dec 2012 12:50:12 +0100
+
 libpve-common-perl (1.0-39) unstable; urgency=low
 
   * remove hardcoded blowfish cipher