ctrl+C

Started by Kathy Zhualmost 23 years ago4 messagesgeneral
Jump to latest
#1Kathy Zhu
Kathy.Zhu@Sun.COM

Hi,

After I do psql, if I hit ctrl+C, it will terminate postmaster.
The message in the log is :

DEBUG: fast shutdown request
DEBUG: aborting any active transactions
FATAL 1: This connection has been terminated by the administrator.
DEBUG: shutting down
DEBUG: database system is shut down

I wonder how to disable ctrl+c shutting down db.
thanks,
kathy

#2Nigel J. Andrews
nandrews@investsystems.co.uk
In reply to: Kathy Zhu (#1)
Re: ctrl+C

On Mon, 12 May 2003, Kathy Zhu wrote:

Hi,

After I do psql, if I hit ctrl+C, it will terminate postmaster.
The message in the log is :

DEBUG: fast shutdown request
DEBUG: aborting any active transactions
FATAL 1: This connection has been terminated by the administrator.
DEBUG: shutting down
DEBUG: database system is shut down

I wonder how to disable ctrl+c shutting down db.
thanks,
kathy

That is not what I get in psql. Are you sure that is what you mean. Perhaps you
mean you have started the postmaster and in the same terminal issued the
ctrl-c?

Can you give more details? PostgreSQL version, OS, the commands issued spring
to mind as being useful to know.

--
Nigel J. Andrews

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kathy Zhu (#1)
Re: ctrl+C

Kathy Zhu <Kathy.Zhu@Sun.COM> writes:

After I do psql, if I hit ctrl+C, it will terminate postmaster.

It sounds like you've launched the postmaster from the same shell you
are running psql in, and the shell thinks that the postmaster is still
part of the process group it should kill on control-C.

You didn't say what OS this is, but you probably need one or both of:

* launch the postmaster from a different shell process (making a script
to launch it will fix this);

* make sure postmaster's stdin, stdout, stderr are all redirected away
from the terminal.

regards, tom lane

#4Jan Wieck
JanWieck@Yahoo.com
In reply to: Kathy Zhu (#1)
Re: ctrl+C

Tom Lane wrote:

Kathy Zhu <Kathy.Zhu@Sun.COM> writes:

After I do psql, if I hit ctrl+C, it will terminate postmaster.

It sounds like you've launched the postmaster from the same shell you
are running psql in, and the shell thinks that the postmaster is
still part of the process group it should kill on control-C.

You didn't say what OS this is, but you probably need one or both of:

* launch the postmaster from a different shell process (making a
script to launch it will fix this);

* make sure postmaster's stdin, stdout, stderr are all redirected
away from the terminal.

On some OSs redirecting does not automatically detach from the control
terminal.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #