# HG changeset patch # User normaldotcom # Date 2010-05-28 17:22:40 # Node ID b6511767dab2935076077f90aeb042b5fa8a2653 # Parent abcf8952747b329d7bdbf6dcf3c998fd55b377b5 Added additional debug if's to make output cleaner diff --git a/etc/distrenslave.conf.in b/etc/distrenslave.conf.in --- a/etc/distrenslave.conf.in +++ b/etc/distrenslave.conf.in @@ -3,6 +3,7 @@ slave username = "!username" datadir = "@LOCALSTATEDIR@/@PACKAGE@" server = "protofusion" + hostname = "protofusion.org" } include("distrencommon.conf") diff --git a/src/server/simpleslave.c b/src/server/simpleslave.c --- a/src/server/simpleslave.c +++ b/src/server/simpleslave.c @@ -29,7 +29,8 @@ #include #include -#define DEBUG 1 +#define DEBUG 0 + int main(int argc, char *argv[]) { @@ -141,7 +142,7 @@ int main(int argc, char *argv[]) char *pathtoTar; /* Full path to the location of the job#.tgz */ char *pathtoTardir; - // Temporary for uncomressed testing + // Temporary for uncompressed testing char *urltoJobfile; char *urltoOutput; /* Full URL where output is posted */ diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -41,6 +41,7 @@ #include +#define DEBUG 0 /** Sends the server a single request (see protocol.h) */ @@ -189,7 +190,8 @@ CURLcode curlpost(char *filename, char * char *sframenum; char *sslavekey; - fprintf(stderr,"Uploading to %s\n", url); + if(DEBUG) + fprintf(stderr,"Uploading to %s\n", url); _distren_asprintf(&sjobnum,"%d",jobnum); _distren_asprintf(&sframenum,"%d",framenum); @@ -315,24 +317,28 @@ int exec_blender(char *input, char *outp char *command = "blender"; // @TODO: We currently expect this to be in PATH char *cmd[] = { command, "-b", input, "-o", output, "-f", frame_str, "-t", "0", (char *)NULL }; // arguments for blender - fprintf(stderr,"Preparing to execute command: %s -b %s -o %s -f %s\n", command, input, output, frame_str); + if(DEBUG) + fprintf(stderr,"Preparing to execute command: %s -b %s -o %s -f %s\n", command, input, output, frame_str); char buf[20]; struct execio *testrem; size_t readlen; - fprintf(stderr,"Executing: %s\n", frame_str); + if(DEBUG) + fprintf(stderr,"Executing: %s\n", frame_str); + ret = execio_open(&testrem, command, cmd); if(ret) { - fprintf(stderr, "error running blender\n"); + fprintf(stderr, "Error running blender\n"); return 1; } buf[19] = '\0'; while(!execio_read(testrem, buf, 19, &readlen)) { buf[readlen] = '\0'; - fprintf(stderr, "read \"%s\"\n", buf); + if(DEBUG) + fprintf(stderr, "read \"%s\"\n", buf); } execio_close(testrem); free(frame_str); @@ -409,7 +415,11 @@ int uploadOutput(char *pathtoOutput, cha //fprintf(stderr,"Uploading output %s to url %s for job %d and frame %d for slavekey %d", pathtoOutput, urltoOutput, jobnum, framenum, slavekey); if( !curlpost(pathtoOutput, urltoOutput, jobnum, framenum, slavekey)) // Uploads output { - fprintf(stderr,"Upload successful, removing old output...\n"); + if(DEBUG) + fprintf(stderr,"Upload successful, removing old output...\n"); + else + fprintf(stderr,"Upload completed\n"); + remove(pathtoOutput); // Delete the file after its uploaded return 0; }