]> git.proxmox.com Git - pve-access-control.git/commitdiff
add new environment type 'ha'
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 13 Dec 2011 09:07:12 +0000 (10:07 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 13 Dec 2011 09:09:15 +0000 (10:09 +0100)
We use this to mark tasks started by HA manager (rgmanager agents).

Makefile
PVE/RPCEnvironment.pm
changelog.Debian

index 3ff3c55efb86eb9b9b4fa8b68e20e16d68d4ba96..c7c9e6487dbc870006a021d3c7af92380d3c0f61 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.0
 
 VERSION=1.0
 PACKAGE=libpve-access-control
 
 VERSION=1.0
 PACKAGE=libpve-access-control
-PKGREL=3
+PKGREL=4
 
 DESTDIR=
 PREFIX=/usr
 
 DESTDIR=
 PREFIX=/usr
index a0c0c3328f2313ce0f73d1e453808ea6b4f968ee..71e2c43b782d937c4e1b130fc6a3d377ce1f3f5b 100644 (file)
@@ -180,7 +180,7 @@ sub init {
 
     die "already initialized" if $pve_env;
 
 
     die "already initialized" if $pve_env;
 
-    die "unknown environment type" if !$type || $type !~ m/^(cli|pub|priv)$/;
+    die "unknown environment type" if !$type || $type !~ m/^(cli|pub|priv|ha)$/;
 
     $SIG{CHLD} = $worker_reaper;
 
 
     $SIG{CHLD} = $worker_reaper;
 
@@ -188,6 +188,7 @@ sub init {
     # cli  ... command started fron command line
     # pub  ... access from public server (apache)
     # priv ... access from private server (pvedaemon)
     # cli  ... command started fron command line
     # pub  ... access from public server (apache)
     # priv ... access from private server (pvedaemon)
+    # ha   ... access from HA resource manager agent (rgmanager)
     
     my $self = {
        user_cfg => {},
     
     my $self = {
        user_cfg => {},
@@ -637,6 +638,9 @@ sub fork_worker {
        POSIX::read($csync[0], $readbuf, 4096);
        die "parent setup error\n" if $readbuf ne 'OK';
 
        POSIX::read($csync[0], $readbuf, 4096);
        die "parent setup error\n" if $readbuf ne 'OK';
 
+       if ($self->{type} eq 'ha') {
+           print "task started by HA resource agent\n";
+       }
        eval { &$function($upid); };
        my $err = $@;
        if ($err) {
        eval { &$function($upid); };
        my $err = $@;
        if ($err) {
index 27b9f09b7d71f9d26e58151ff3b5b0f0162136cb..cda85574dcd963b69d8ae63c2fcdfef38f2b3fc8 100644 (file)
@@ -1,3 +1,9 @@
+libpve-access-control (1.0-4) unstable; urgency=low
+
+  * new environment type for ha agents
+
+ -- Proxmox Support Team <support@proxmox.com>  Tue, 13 Dec 2011 10:08:53 +0100
+
 libpve-access-control (1.0-3) unstable; urgency=low
 
   * add support for delayed parameter parsing - We need that to disable
 libpve-access-control (1.0-3) unstable; urgency=low
 
   * add support for delayed parameter parsing - We need that to disable