Changeset 5c504ea485ce116afcce91a9bb8027803f5f9c02

Show
Ignore:
Timestamp:
04/09/07 02:34:46 (8 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1176086086 +0000
git-parent:

[eb13d729653537edd09653c474ba43993b785073]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1176086086 +0000
Message:

a hack to make this work in multiple concurrent zones

git-svn-id: https://labs.omniti.com/resmon/trunk@39 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Status.pm

    r9c26e33 r5c504ea  
    163163  listen($handle,SOMAXCONN); 
    164164 
     165  $self->{zindex} = 0; 
     166  if (-x "/usr/sbin/zoneadm") { 
     167    open(Z, "/usr/sbin/zoneadm list -p |"); 
     168    my $firstline = <Z>; 
     169    close(Z); 
     170    ($self->{zindex}) = split /:/, $firstline, 2; 
     171  } 
    165172  $self->{http_port} = $port; 
    166173  $self->{http_ip} = $ip; 
     174  $self->{ftok_number} = $port * (1 + $self->{zindex}); 
    167175 
    168176  $self->{child} = fork(); 
     
    230238 
    231239  unless($self->{shared_state}) { 
    232     my $id = ftok(__FILE__,$self->{http_port}); 
     240    my $id = ftok(__FILE__,$self->{ftok_number}); 
    233241    $self->{shared_state} = shmget($id, $SEGSIZE, 
    234242                                   IPC_CREAT|S_IRWXU|S_IRWXG|S_IRWXO)