summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2008-02-17 19:40:38 +0000
committerPreston Cody <codeman@gentoo.org>2008-02-17 19:40:38 +0000
commita519d213fa9af075d9d94dbec990ab85fc34d5cf (patch)
tree92a866ae389e62ccaa7308ce6451e5f8c8e38d66
parentlet's actually run the jobs we get...untested (diff)
downloadscire-a519d213fa9af075d9d94dbec990ab85fc34d5cf.tar.gz
scire-a519d213fa9af075d9d94dbec990ab85fc34d5cf.tar.bz2
scire-a519d213fa9af075d9d94dbec990ab85fc34d5cf.zip
removing some comments. small other touchups.
svn path=/branches/new-fu/; revision=357
-rwxr-xr-xserver/scireserver.pl18
1 files changed, 3 insertions, 15 deletions
diff --git a/server/scireserver.pl b/server/scireserver.pl
index fa5de61..1af39ee 100755
--- a/server/scireserver.pl
+++ b/server/scireserver.pl
@@ -55,7 +55,7 @@ my $dbh = DBI->connect($connect_string, $conf{db_user}, $conf{db_passwd}, { Rai
while(<>) {
my ($command, @args) = parse_command($_);
# chomp( my $line = $_);
-# debug("DEBUG: line is: $line");
+ debug("DEBUG: line is: $_");
# SEE http://agaffney.org/mediawiki/index.php/SSH-based_protocol for documentation on the protocol.
if($command eq "QUIT") {
@@ -97,7 +97,7 @@ while(<>) {
my @filenames = ("$conf{job_dir}/$client_id/result/$jobid.stdout", "$conf{job_dir}/$client_id/result/$jobid.stderr");
print "OK " . join(" ", @filenames) . "\n";
} elsif ($command eq "JOBFILE_SENT") {
- my @filenames = @args;
+ my @jobfiles = @args;
process_jobfile($_) foreach(@jobfiles);
print "OK\n"
} else {
@@ -144,9 +144,6 @@ sub register_client {
eval {
run_query('LOCK TABLES `gacl_axo_seq` WRITE');
-# debug("Query is $query");
- #execute it
-# $dbh->do($query);
$query = 'SELECT id FROM `gacl_axo_seq`';
$sth = run_query($query);
$id = $sth->fetchrow_hashref->{'id'};
@@ -154,8 +151,6 @@ sub register_client {
$query = 'UPDATE `gacl_axo_seq` SET id=?';
run_query($query,$id);
run_query('UNLOCK TABLES');
-# debug("Query is $query");
-# $dbh->do($query);
};
($@) and print "ERROR during fetching of id sequence: $DBI::errstr\n";
@@ -165,7 +160,6 @@ sub register_client {
#NOTE: not sure if this query is still valid. may be using id instead of hostname for one of those two now.
$query = 'INSERT INTO clients (clientid,digest,hostname,mac,ip,status) VALUES (?,?,?,?,?,?)';
- #execute with $id, client_cert.digest("sha1"),crypto.dump_certificate(crypto.FILETYPE_PEM,client_cert),$hostname,$mac,$ip,$status_id))
run_query($query,$id,$digest,$hostname,$mac,$ip,$status_id);
};
($@) and print "ERROR Could not insert client with $query: $DBI::errstr\n";
@@ -183,14 +177,11 @@ sub identify_client {
my $query = 'SELECT client_status.statusname, clients.clientid FROM clients JOIN client_status on (clients.status = client_status.statusid) WHERE clients.digest=?';
my $sth = run_query($query,$digest);
- #debug("Query is $query");
- #my $sth = $dbh->prepare($query);
- #$sth->execute($digest);
my $hashref = $sth->fetchrow_hashref();
debug(Dumper($hashref));
my $status_name = $hashref->{'statusname'};
$client_id = $hashref->{'clientid'};
- if (defined($client_id) and $client_id > 0) { #and ($status_name eq 'Active') {
+ if (defined($client_id) and ($client_id > 0) and ($status_name eq 'Active')) {
$identified = 1;
print "OK\n";
} else {
@@ -216,9 +207,6 @@ EndOfQuery
#FIXME ADD JOB DEPENDENCIES TO THIS QUERY.
my $sth = run_query($query,$client_id);
-# debug("Query is $query");
-# my $sth = $dbh->prepare($query);
-# $sth->execute($client_id);
my $jobs_ref = $sth->fetchall_arrayref();
# Don't ask me...ask the guys in #perl :P
my @jobs = map { @$_ } @$jobs_ref;