X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4223D14B2804 for ; Mon, 9 Aug 2004 11:45:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42736-05 for ; Mon, 9 Aug 2004 14:45:01 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 356DE14B27FB for ; Mon, 9 Aug 2004 11:45:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i79Ej5Yx014654; Mon, 9 Aug 2004 10:45:05 -0400 (EDT) To: "Kevin Izzet" Cc: pgsql-admin@postgresql.org Subject: Re: psql won't stayed connected In-reply-to: References: Comments: In-reply-to "Kevin Izzet" message dated "Mon, 09 Aug 2004 11:04:49 +0100" Date: Mon, 09 Aug 2004 10:45:04 -0400 Message-ID: <14653.1092062704@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/40 X-Sequence-Number: 14435 "Kevin Izzet" writes: > Below is an extract from a truss of the psql login, looks fine to me, Not really. Here we have the successful connection to the server: > 937: send(4, "\0\0\0 #\003\0\0 u s e r".., 35, 0) = 35 > 937: sigaction(SIGPIPE, 0xFFBEEAC8, 0xFFBEEB48) = 0 > 937: poll(0xFFBEED78, 1, -1) = 1 > 937: recv(4, " R\0\0\0\b\0\0\0\0 N\0\0".., 16384, 0) = 75 > 937: write(2, " D E B U G : I n i t".., 21) = 21 > 937: poll(0xFFBEED78, 1, -1) = 1 > 937: recv(4, " S\0\0\01E c l i e n t _".., 16384, 0) = 155 and here is psql doing its normal initialization: > 937: access("/home/kevini/.psqlrc-7.4.3", 4) Err#2 ENOENT > 937: access("/home/kevini/.psqlrc", 4) Err#2 ENOENT > 937: getcontext(0xFFBEEDE0) > 937: sigaction(SIGINT, 0xFFBEEED8, 0xFFBEEF58) = 0 > 937: ioctl(0, TCGETA, 0xFFBEE9BC) Err#6 ENXIO > 937: fstat64(0, 0xFFBEEA30) = 0 > 937: brk(0x0004CC48) = 0 > 937: brk(0x0004EC48) = 0 and here it's trying to read the first command from stdin, and getting EOF back: > 937: read(0, 0x0004ADB4, 8192) = 0 whereupon it quite correctly decides to close up shop: > 937: sigaction(SIGINT, 0xFFBEEED8, 0xFFBEEF58) = 0 > 937: sigaction(SIGPIPE, 0xFFBEECC0, 0xFFBEED40) = 0 > 937: send(4, " X\0\0\004", 5, 0) = 5 > 937: sigaction(SIGPIPE, 0xFFBEECC0, 0xFFBEED40) = 0 > 937: close(4) = 0 > 937: sigaction(SIGPIPE, 0xFFBEEF10, 0xFFBEEF90) = 0 > 937: llseek(0, 0, SEEK_CUR) = 0 > 937: _exit(0) So why the heck is it getting EOF from stdin? You're not doing anything as silly as "psql