From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Izzet <Kevin.Izzet@nsc.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: psql won't stayed connected
Date: Mon, 09 Aug 2004 10:45:04 -0400
Message-ID: <14653.1092062704@sss.pgh.pa.us> (raw)
In-Reply-To: <OF47B82B48.D4822776-ON80256EEB.0033EC2A-80256EEB.00375FA3@nsc.com>
References: <OF47B82B48.D4822776-ON80256EEB.0033EC2A-80256EEB.00375FA3@nsc.com>
"Kevin Izzet" <Kevin.Izzet@nsc.com> 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 </dev/null" are you?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, Kevin.Izzet@nsc.com
Subject: Re: psql won't stayed connected
In-Reply-To: <14653.1092062704@sss.pgh.pa.us>
References: <OF47B82B48.D4822776-ON80256EEB.0033EC2A-80256EEB.00375FA3@nsc.com> <14653.1092062704@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox