X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A0A7E475B85 for ; Fri, 9 May 2003 11:14:26 -0400 (EDT) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id 138A5475AE5 for ; Fri, 9 May 2003 11:14:16 -0400 (EDT) Received: (qmail 10984 invoked by uid 500); 9 May 2003 15:15:36 -0000 Date: Fri, 9 May 2003 10:15:36 -0500 From: Bruno Wolff III To: mlaks Cc: pgsql-admin@postgresql.org Subject: Re: Multiple Postmasters - Automatic Shutdown -Tom Lane Message-ID: <20030509151536.GA10878@wolff.to> Mail-Followup-To: mlaks , pgsql-admin@postgresql.org References: <200305090947.26864.mlaks@bellatlantic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200305090947.26864.mlaks@bellatlantic.net> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-38.0 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT 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/123 X-Sequence-Number: 8685 On Fri, May 09, 2003 at 09:47:26 -0400, mlaks wrote: > > I copied the clause > > pid = $(pidof -s /usr/bin/postmaster) > if [ pid] > then echo $" Postmaster is already running." > else > > from Lamar Owen's postgresql service script on RedHat linux. > (Q. why does he put echo $" Postmaster is already running " instead of just > echo "Postmaster is already running" ?) I am not sure what the $ does there. > I need your expert opinion. I am a complete ignoramous about this. In your > wide experience, > In this very restricted circumstance, even though I am violating Tom's rule of > running the > rm -f /var/lib/pgsql/data/postmaster.pid beyond boot time, will I possibly > start 2 postmasters at once? > Am I shooting myself in the foot? Doing this at boot time before running svscan is reasonable. You know postmaster shouldn't be running at that point. This is also a case when you are likely to get a spurious conflict as the process id given to postmaster in the last reboot is likely to be low and if there is some varience in the boot process some other process might get it this time and prevent postmaster from coming up. I wouldn't remove the lockfile in the run file as that isn't likely to benefit you and might cause serious problems for you.