added TEAL sepaphore.pm to the rmc package
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8145 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		
							
								
								
									
										22
									
								
								xCAT-rmc/lib/perl/TEAL/Semaphore.pm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								xCAT-rmc/lib/perl/TEAL/Semaphore.pm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
package TEAL::Semaphore;
 | 
			
		||||
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
require IPC::SysV;
 | 
			
		||||
 | 
			
		||||
sub new {
 | 
			
		||||
    my $class = shift;
 | 
			
		||||
    my $self = {};
 | 
			
		||||
    my $key = IPC::SysV::ftok("/var/log/teal",0x646c6100);
 | 
			
		||||
    $self->{ID} = semget($key,1,0);
 | 
			
		||||
    bless $self,$class;
 | 
			
		||||
    return $self;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub post {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    my $op = pack("s!3",0,1,0);
 | 
			
		||||
    semop $self->{ID},$op || die "failed to post"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
@@ -35,6 +35,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon
 | 
			
		||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts
 | 
			
		||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts/rmcmon/resources
 | 
			
		||||
mkdir -p $RPM_BUILD_ROOT/install/postscripts/rmcmon/scripts
 | 
			
		||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
 | 
			
		||||
 | 
			
		||||
set +x
 | 
			
		||||
cp plugin/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring
 | 
			
		||||
@@ -42,6 +43,9 @@ cp -r resources $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/rmc
 | 
			
		||||
 | 
			
		||||
cp scripts/* $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon
 | 
			
		||||
chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon/*
 | 
			
		||||
 | 
			
		||||
cp lib/perl/TEAL/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
 | 
			
		||||
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
cp scripts/configrmcnode $RPM_BUILD_ROOT/install/postscripts
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user