source: trunk/debathena/debathena/larvnet/debian/busyd @ 23682

Revision 23682, 459 bytes checked in by rbasch, 15 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
3use strict;
4
5# Determine if the machine is busy.
6my $result = `pgrep -c larvnet-wrapper`;
7my $busy = ($result > 0) ? 1 : 0;
8
9# Collect some basic information about the machine.
10my $hostname = `hostname --fqdn`;
11my $arch = `machtype -c`;
12chomp $hostname;
13chomp $arch;
14
15# Read the packet.
16my $addr = recv(STDIN, my $dummy, 1, 0);
17
18# Reply with the status packet.
19my $msg = $busy . $hostname . "\0" . $arch . "\0";
20send(STDOUT, $msg, 0, $addr);
Note: See TracBrowser for help on using the repository browser.