add new environment type 'ha'

We use this to mark tasks started by HA manager (rgmanager agents).
This commit is contained in:
Dietmar Maurer 2011-12-13 10:07:12 +01:00
parent dcfaabd7ca
commit e42eedbca4
3 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=1.0 VERSION=1.0
PACKAGE=libpve-access-control PACKAGE=libpve-access-control
PKGREL=3 PKGREL=4
DESTDIR= DESTDIR=
PREFIX=/usr PREFIX=/usr

View 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 # cli ... command started fron command line
# pub ... access from public server (apache) # pub ... access from public server (apache)
# priv ... access from private server (pvedaemon) # priv ... access from private server (pvedaemon)
# ha ... access from HA resource manager agent (rgmanager)
my $self = { my $self = {
user_cfg => {}, user_cfg => {},
@ -637,6 +638,9 @@ sub fork_worker {
POSIX::read($csync[0], $readbuf, 4096); POSIX::read($csync[0], $readbuf, 4096);
die "parent setup error\n" if $readbuf ne 'OK'; 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); }; eval { &$function($upid); };
my $err = $@; my $err = $@;
if ($err) { if ($err) {

View 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 libpve-access-control (1.0-3) unstable; urgency=low
* add support for delayed parameter parsing - We need that to disable * add support for delayed parameter parsing - We need that to disable