job.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* remote coshell server job and connection support
*/
#include "service.h"
/*
* drop a connection
*/
void
{
register int i;
register int n;
{
case USER:
{
}
/*FALLTHROUGH*/
case INIT:
{
close(n);
}
break;
case PASS:
{
sfstrclose(tp);
}
{
}
break;
case POLL:
break;
case SHELL:
break;
}
}
/*
* check the job table for hogs running on busy shells
* or jobs queued on hung shells
* if only!=0 then only that shell is checked
*/
void
{
char* s;
{
{
{
continue;
}
{
{
{
{
int n;
error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d %s", sp->name, jp - state.job, jp->pid, state.migrate);
n = sfprintf(state.string, "job=%d; pid=%d; host=%s; type=%s; %s\n", jp - state.job, jp->pid, sp->name, sp->type, state.migrate);
else
}
else
{
#ifdef SIGSTOP
error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d stopped", sp->name, jp - state.job, jp->pid);
#else
error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d is a hog", sp->name, jp - state.job, jp->pid);
#endif
}
}
continue;
}
}
{
#ifdef SIGCONT
error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "job %d pid %d restarted on %s", jp - state.job, jp->pid, sp->name);
#else
error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "job %d pid %d is no longer hogging %s", jp - state.job, jp->pid, sp->name);
#endif
}
}
{
{
if (state.running < (state.perserver + state.jobwait) && state.con[jp->fd].info.user.running < (state.peruser + 1) && (sp == &state.wait || sp->running < ((state.perhost ? state.perhost : sp->cpu * state.percpu) + 1)))
}
{
}
}
}
}
/*
* kill job with sig
*/
void
{
int n;
char buf[128];
{
{
}
}
}
/*
* job jp is done
*/
void
{
register int n;
char buf[64];
{
}
{
{
}
}
{
{
}
#ifdef SIGCONT
#else
#endif
n = sfsprintf(buf, sizeof(buf), "x %d %d %s %s\n", jp->rid, jp->status, fmtelapsed(jp->user, CO_QUANT), fmtelapsed(jp->sys, CO_QUANT));
}
}