Parent document is top of "comp.sys.hp.hpux FAQ"
Previous document is "7.22 How can I print man pages successfully?"
Next document is "7.24 Can I put more than one backup on DDS with fbackup?"

7.23 How can I limit core files?

HP-UX has no built in function to limit core file generation from the standard
shells; one way to limit core file generation is to create a directory called
"core" with 000 permissions in the directory in which you expect a core dump
to occur. Additionally, two programs are available (nocore and corelimit)
that can be used as wrappers around other programs that you may expect to
dump.  And, some publicly available shells (tcsh, for example) allow core
file limits. Or, you can place a link called "core" to /dev/null in the
directory you expect the core dump to occur.

Note that at 10.10 and newer HP-UX revisions, the csh limit commands 
work as you would expect.

Here is the source for corelimit (thanks to John Agosta, HP). It is
completely unsupported; the Response Center will disavow all knowledge
of you and your mission should you call them with a problem relating
to this. Build it in the usual way (cc -o corelimit corelimit.c) and use it
in the format of:  "corelimit hpterm 0". This will limit the core file
size of all children of the hpterm process to 0.

#include <stdio.h>
#include <sys/resource.h>
#define RLIMIT_CORE     4               /* core file size */

main(argc, argv)
int argc;
char **argv;
{
int res;
struct rlimit rlp;
        if (argc != 3) {
           fprintf(stderr, "%s: wrong number of parameters\n", argv[0]);
           fprintf(stderr, "\tformat: %s command core_size\n", argv[0]);
           exit(-1);
        }
        rlp.rlim_cur = atoi(argv[2]);
        res = setrlimit(RLIMIT_CORE, &rlp);
        if (res < 0) {
                perror("setrlimit: RLIMIT_CORE");
                exit(-2);
        }
        system(argv[1]);
}

Or, you can edit /etc/vuerc to start all of VUE that way:

at line 22 replace:
  exec $VUELOGIN $VL_ARGS </dev/null >/dev/null 2>&1
by:
  exec /usr/local/bin/nocore $VUELOGIN $VL_ARGS </dev/null >/dev/null 2>&1

(thanks to Jean-Claude Arnouil, <arnouilj@esiee.fr>)

Parent document is top of "comp.sys.hp.hpux FAQ"
Previous document is "7.22 How can I print man pages successfully?"
Next document is "7.24 Can I put more than one backup on DDS with fbackup?"