
Some lingering problems:

On Irix6.0, when running the limit command in a batch script, cputime reports
incorrect time limit, both with limit & limit -h, and with both csh & sh. They
differ from the actual settings shown with qstat. Also, it's the correct qstat
limits that gets enforced (see below). This might well be an irix problem...

Furthermore, to get cputime limit enforced, I have to start the nqs deamons
with

	respawn qmgr start nqs

where respawn (included) enables SIGXCPU and SIGXFSZ signals (defaults to
disabled in Irix5&6); maybe you want to incorporate this in the code.


-- 
Kristian Wedberg  University of Gothenburg     wedberg@mednet.gu.se
                  MEDNET                       Tel:  +46 31 7733762
System Manager @  Medicinaregatan 7B           Fax:  +46 31 7733758
                  S-413 90 Gothenburg, SWEDEN  Home: +46 31 219395

--PART-BOUNDARY=.19411042311.ZM18608.mednet.gu.se
Encoding: 44 text
X-Zm-Content-Name: respawn.c
Content-Description: plain text
Content-Type: text/plain ; charset=us-ascii

/*
The problem here is that IRIX 5.1.takes the SVR4 approach to handling
SIGXCPU and SIGXFSZ, which is to ignore them by default.  As a result,
programs inherit this signal setting and actually ignore SIGXCPU and
SIGXFSZ.  Unfortunately, this is not what IRIX 4 does, and it produces 
extremely counter-intuitive behavior.  We've fixed this problem in IRIX 5.2, 
but until then you need to explicitly reset the signal handling for SIGXCPU 
and SIGXFSZ to their default values if you intend to use them.  The following 
program illustrates how this might be done.
*/

/*
 * respawn.c -- Sets the SIGXCPU and SIGXFSZ signals to their default
 *      values and then executes the command given. 
 *      To compile this program, just type:
 *               cc -o respawn respawn.c
 *
 *      Example:
 *              respawn /usr/people/jfk/testprog -x
 *      will enable the signals and then execute testprog with the -x flag.
 */
 
#include <stdio.h>
#include <sys/signal.h>

main(int argc, char *argv[])
{
    char *pathname = argv[1];
    
    argv++;

    if (!pathname || !pathname[0]) {
        fprintf(stderr, "respawn: Invalid path name '%s'\n", pathname);
        exit(1);
    }

    sigset(SIGXCPU, SIG_DFL);
    sigset(SIGXFSZ, SIG_DFL);

    if (execv(pathname, argv) == -1) {
        perror("respawn: execv failed");
        exit(1);
    }
}

--PART-BOUNDARY=.19411042311.ZM18608.mednet.gu.se--



