version 1.24, 2000/03/26 16:08:27 |
version 1.25, 2000/03/26 16:21:32 |
|
|
(void) fprintf(stdout, "JobPassSig(%d) called.\n", signo); |
(void) fprintf(stdout, "JobPassSig(%d) called.\n", signo); |
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo); |
Lst_ForEach(jobs, JobCondPassSig, &signo); |
|
|
/* |
/* |
* Deal with proper cleanup based on the signal received. We only run |
* Deal with proper cleanup based on the signal received. We only run |
|
|
(void) KILL(getpid(), signo); |
(void) KILL(getpid(), signo); |
|
|
signo = SIGCONT; |
signo = SIGCONT; |
Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo); |
Lst_ForEach(jobs, JobCondPassSig, &signo); |
|
|
(void) sigprocmask(SIG_SETMASK, &omask, NULL); |
(void) sigprocmask(SIG_SETMASK, &omask, NULL); |
sigprocmask(SIG_SETMASK, &omask, NULL); |
sigprocmask(SIG_SETMASK, &omask, NULL); |
|
|
job->node->type |= OP_SAVE_CMDS; |
job->node->type |= OP_SAVE_CMDS; |
if ((job->flags & JOB_IGNDOTS) == 0) { |
if ((job->flags & JOB_IGNDOTS) == 0) { |
job->tailCmds = Lst_Succ(Lst_Member(job->node->commands, |
job->tailCmds = Lst_Succ(Lst_Member(job->node->commands, |
(ClientData)cmd)); |
cmd)); |
return 1; |
return 1; |
} |
} |
return 0; |
return 0; |
|
|
* For debugging, we replace each command with the result of expanding |
* For debugging, we replace each command with the result of expanding |
* the variables in the command. |
* the variables in the command. |
*/ |
*/ |
cmdNode = Lst_Member(job->node->commands, (ClientData)cmd); |
cmdNode = Lst_Member(job->node->commands, cmd); |
cmdStart = cmd = Var_Subst(cmd, job->node, FALSE); |
cmdStart = cmd = Var_Subst(cmd, job->node, FALSE); |
Lst_Replace(cmdNode, (ClientData)cmdStart); |
Lst_Replace(cmdNode, cmdStart); |
|
|
cmdTemplate = "%s\n"; |
cmdTemplate = "%s\n"; |
|
|
|
|
WSTOPSIG(*status)); |
WSTOPSIG(*status)); |
} |
} |
job->flags |= JOB_RESUME; |
job->flags |= JOB_RESUME; |
Lst_AtEnd(stoppedJobs, (ClientData)job); |
Lst_AtEnd(stoppedJobs, job); |
#ifdef REMOTE |
#ifdef REMOTE |
if (job->flags & JOB_REMIGRATE) |
if (job->flags & JOB_REMIGRATE) |
JobRestart(job); |
JobRestart(job); |
|
|
#endif |
#endif |
} |
} |
job->flags &= ~JOB_CONTINUING; |
job->flags &= ~JOB_CONTINUING; |
Lst_AtEnd(jobs, (ClientData)job); |
Lst_AtEnd(jobs, job); |
nJobs += 1; |
nJobs += 1; |
if (!(job->flags & JOB_REMOTE)) { |
if (!(job->flags & JOB_REMOTE)) { |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
|
|
if (job->tailCmds != NULL) { |
if (job->tailCmds != NULL) { |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
JobSaveCommand, |
JobSaveCommand, |
(ClientData)job->node); |
job->node); |
} |
} |
job->node->made = MADE; |
job->node->made = MADE; |
Make_Update(job->node); |
Make_Update(job->node); |
|
|
* Now the job is actually running, add it to the table. |
* Now the job is actually running, add it to the table. |
*/ |
*/ |
nJobs += 1; |
nJobs += 1; |
Lst_AtEnd(jobs, (ClientData)job); |
Lst_AtEnd(jobs, job); |
if (nJobs == maxJobs) { |
if (nJobs == maxJobs) { |
jobFull = TRUE; |
jobFull = TRUE; |
} |
} |
|
|
(void) fprintf(stdout, "*** holding\n"); |
(void) fprintf(stdout, "*** holding\n"); |
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
Lst_AtFront(stoppedJobs, (ClientData)job); |
Lst_AtFront(stoppedJobs, job); |
jobFull = TRUE; |
jobFull = TRUE; |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
(void) fprintf(stdout, "Job queue is full.\n"); |
(void) fprintf(stdout, "Job queue is full.\n"); |
|
|
} |
} |
#endif |
#endif |
|
|
Lst_AtEnd(jobs, (ClientData)job); |
Lst_AtEnd(jobs, job); |
nJobs += 1; |
nJobs += 1; |
if (nJobs == maxJobs) { |
if (nJobs == maxJobs) { |
jobFull = TRUE; |
jobFull = TRUE; |
|
|
(void) fprintf(stdout, "holding\n"); |
(void) fprintf(stdout, "holding\n"); |
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
Lst_AtFront(stoppedJobs, (ClientData)job); |
Lst_AtFront(stoppedJobs, job); |
jobFull = TRUE; |
jobFull = TRUE; |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
(void) fprintf(stdout, "Job queue is full.\n"); |
(void) fprintf(stdout, "Job queue is full.\n"); |
|
|
(void) fprintf(stdout, "table full\n"); |
(void) fprintf(stdout, "table full\n"); |
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
Lst_AtFront(stoppedJobs, (ClientData)job); |
Lst_AtFront(stoppedJobs, job); |
jobFull = TRUE; |
jobFull = TRUE; |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
(void) fprintf(stdout, "Job queue is full.\n"); |
(void) fprintf(stdout, "Job queue is full.\n"); |
|
|
LstNode ln = Lst_Next(gn->commands); |
LstNode ln = Lst_Next(gn->commands); |
|
|
if ((ln == NULL) || |
if ((ln == NULL) || |
JobPrintCommand((ClientData) Lst_Datum(ln), |
JobPrintCommand(Lst_Datum(ln), job)) |
(ClientData) job)) |
|
{ |
{ |
noExec = TRUE; |
noExec = TRUE; |
Lst_Close(gn->commands); |
Lst_Close(gn->commands); |
|
|
* We can do all the commands at once. hooray for sanity |
* We can do all the commands at once. hooray for sanity |
*/ |
*/ |
numCommands = 0; |
numCommands = 0; |
Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job); |
Lst_ForEach(gn->commands, JobPrintCommand, job); |
|
|
/* |
/* |
* If we didn't print out any commands to the shell script, |
* If we didn't print out any commands to the shell script, |
|
|
* doesn't do any harm in this case and may do some good. |
* doesn't do any harm in this case and may do some good. |
*/ |
*/ |
if (cmdsOK) { |
if (cmdsOK) { |
Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job); |
Lst_ForEach(gn->commands, JobPrintCommand, job); |
} |
} |
/* |
/* |
* Don't execute the shell, thank you. |
* Don't execute the shell, thank you. |
|
|
if (job->tailCmds != NULL) { |
if (job->tailCmds != NULL) { |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
Lst_ForEachFrom(job->node->commands, job->tailCmds, |
JobSaveCommand, |
JobSaveCommand, |
(ClientData)job->node); |
job->node); |
} |
} |
Make_Update(job->node); |
Make_Update(job->node); |
} |
} |
|
|
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
job->flags |= JOB_RESTART; |
job->flags |= JOB_RESTART; |
Lst_AtEnd(stoppedJobs, (ClientData)job); |
Lst_AtEnd(stoppedJobs, job); |
} else { |
} else { |
if ((nLocal >= maxLocal) && local) { |
if ((nLocal >= maxLocal) && local) { |
/* |
/* |
|
|
} |
} |
|
|
|
|
jnode = Lst_Find(jobs, JobCmpPid, (ClientData)&pid); |
jnode = Lst_Find(jobs, JobCmpPid, &pid); |
|
|
if (jnode == NULL) { |
if (jnode == NULL) { |
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { |
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { |
jnode = Lst_Find(stoppedJobs, JobCmpPid, (ClientData)&pid); |
jnode = Lst_Find(stoppedJobs, JobCmpPid, &pid); |
if (jnode == NULL) { |
if (jnode == NULL) { |
Error("Resumed child (%d) not in table", pid); |
Error("Resumed child (%d) not in table", pid); |
continue; |
continue; |
|
|
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID); |
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID); |
(void) fflush(stdout); |
(void) fflush(stdout); |
} |
} |
jnode = Lst_Find(jobs, JobCmpRmtID, (ClientData)&hostID); |
jnode = Lst_Find(jobs, JobCmpRmtID, &hostID); |
|
|
if (jnode == NULL) { |
if (jnode == NULL) { |
jnode = Lst_Find(stoppedJobs, JobCmpRmtID, (ClientData)&hostID); |
jnode = Lst_Find(stoppedJobs, JobCmpRmtID, &hostID); |
if (jnode == NULL) { |
if (jnode == NULL) { |
if (DEBUG(JOB)) { |
if (DEBUG(JOB)) { |
Error("Evicting host(%d) not in table", hostID); |
Error("Evicting host(%d) not in table", hostID); |