1 start include statements
2 my $prefix = '/var/lib/moshog';
3 my $request_directory = "$prefix/requests";
4 my $grant_directory = "$prefix";
12 my $start_threads = $self -> {'start_threads'} ;
13 my $granted_threads = $self -> {'granted_threads'} ;
15 if( -e
"$request_directory/$$" ){
16 unlink( "$request_directory/$$" );
19 if( open( REQUEST
, '>moshog_request' ) ){
20 #flock( REQUEST, 2 ); # 2 is FLOCK_EX
21 print( REQUEST
"S:$start_threads R:$request\n" );
22 #flock( REQUEST, 8 ); # 8 is FLOCK_UN
24 system( 'ln -s `pwd`/moshog_request ' . "$request_directory/$$" );
27 # This is a pipe open, therefore we will have an alarm set to
28 # revive us if no-one is listening (ie moshog is dead)
31 # $SIG{ALRM} = sub { die };
33 # open( WAKEUP, ">$grant_directory/wakeup" );
34 # print WAKEUP "junk\n";
39 $self -> {'last_request'} = $request;
47 # $SIG{ALRM} = sub { die };
49 if( -e
"$grant_directory/$$" ){
50 if( open( GRANT
, "<$grant_directory/$$" ) ){
51 my @grant_arr = <GRANT
>;
53 $grant = $grant_arr[0];
56 $self -> {'granted_threads'} = $grant;