Revision 23682,
459 bytes
checked in by rbasch, 16 years ago
(diff) |
In larvnet:
* Use STDOUT, not STDIN, to send the busyd status reply.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | |
---|
5 | # Determine if the machine is busy. |
---|
6 | my $result = `pgrep -c larvnet-wrapper`; |
---|
7 | my $busy = ($result > 0) ? 1 : 0; |
---|
8 | |
---|
9 | # Collect some basic information about the machine. |
---|
10 | my $hostname = `hostname --fqdn`; |
---|
11 | my $arch = `machtype -c`; |
---|
12 | chomp $hostname; |
---|
13 | chomp $arch; |
---|
14 | |
---|
15 | # Read the packet. |
---|
16 | my $addr = recv(STDIN, my $dummy, 1, 0); |
---|
17 | |
---|
18 | # Reply with the status packet. |
---|
19 | my $msg = $busy . $hostname . "\0" . $arch . "\0"; |
---|
20 | send(STDOUT, $msg, 0, $addr); |
---|
Note: See
TracBrowser
for help on using the repository browser.