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

Revision 23128, 458 bytes checked in by ghudson, 16 years ago (diff)
In larvnet: * Use a better test for the workstation's busy state. * Run busyd as nobody.
  • 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(STDIN, $msg, 0, $addr);
Note: See TracBrowser for help on using the repository browser.