Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA01568; Fri, 8 Nov 91 05:32:41 -0800
Date: Fri, 8 Nov 91 05:32:41 -0800
Message-Id: <9111081332.AA01568@postgres.Berkeley.EDU>
From: tom@izf.tno.nl (Tom Vijlbrief)
Subject: monitor -c ".." eats inodes
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Hi Postgres users/developers,

Last night I ran an endless shell script with monitor -c commands
and ran GEO in a continues data retrieve mode.

I wanted to test for memory leaks (there are none
in GEO and postgres or at least no large ones, except that postgres
has problems with true multiuser accesses as reported before and
the vacuum command gets confused in this situation. Also the system
slows down, probably the result of the failing vacuum ? )

This morning my workstation was out of inodes.

The monitor -c command does not remove the /tmp/PQ* files !

FIX:

Change init_tmon to:

init_tmon()
{
  if (!RunOneCommand) {
    char *temp_editor = getenv("EDITOR");
    int handle_exit();
    
    if (temp_editor != NULL) 
    user_editor = temp_editor;
    else
    user_editor = DEFAULT_EDITOR;

    tmon_temp_filename = malloc(20);
    sprintf(tmon_temp_filename, "/tmp/PQ%d", getpid());
    tmon_temp = open(tmon_temp_filename,O_CREAT | O_RDWR | O_APPEND,0666);
  }

    /* Catch signals so we can delete the scratch file GK */

    signal(SIGHUP, handle_exit);
    signal(SIGQUIT, handle_exit);
    signal(SIGTERM, handle_exit);
    signal(SIGINT, handle_exit);
}

