X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C2255475AE5 for ; Fri, 9 May 2003 09:04:35 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 12A6F475A80 for ; Fri, 9 May 2003 09:04:35 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h49D4bU6000110; Fri, 9 May 2003 09:04:37 -0400 (EDT) To: Bruno Wolff III Cc: dlangschied , pgsql-admin@postgresql.org Subject: Re: Automatic shutdown from Linux. In-reply-to: <20030509125607.GA10138@wolff.to> References: <002601c31626$229da170$6401a8c0@lcshost> <20030509125607.GA10138@wolff.to> Comments: In-reply-to Bruno Wolff III message dated "Fri, 09 May 2003 07:56:07 -0500" Date: Fri, 09 May 2003 09:04:37 -0400 Message-ID: <109.1052485477@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.3 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/119 X-Sequence-Number: 8681 Bruno Wolff III writes: > Probably the init scripts for your system already do this for you. > If you system displays a message for each service being shutdown > during a shutdown you should be able to watch and see if postgres > is shutdown as part of that process. Also, in a conventionally-run Unix system the database will shut down cleanly even without any init-script help. This is because the postmaster and backends are designed (with malice aforethought ;-)) to interpret SIGTERM as a fast-shutdown request. Assuming that the kernel gives user processes a reasonable number of seconds between SIGTERM and SIGKILL --- enough for a checkpoint --- you don't really need anything else. One reason not to crank shared_buffers up to the moon is that with a huge number of dirty buffers, checkpoint might take too long for this scenario to be robust. On my HPUX box, the kernel will give twenty seconds' grace between SIGTERM and SIGKILL, which is enough for even a pretty messy checkpoint, but I dunno what the equivalent delay is on other platforms. regards, tom lane