Re: Change 'pg_ctl: no server running' Exit Status to 3

Lists: pgsql-hackers
From: "Aaron W(dot) Swenson" <aaron(dot)w(dot)swenson(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Change 'pg_ctl: no server running' Exit Status to 3
Date: 2011-05-24 00:50:53
Message-ID: 4DDB00ED.8040301@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

According to Linux Standard Base Core Specification 3.1 [1], the exit
status should be '3' when the server isn't running.

I've attached a very simple patch that resolves this cosmetic issue,
which applies to all branches.

My initial search regarding other platforms has turned up nil. It looks
like they just check for a zero or non-zero exit status.

As for the necessity of the patch: Gentoo Linux uses pg_ctl in all of
its initscript actions for PostgreSQL. I'd imagine that Gentoo is not
the only distribution that takes advantage of pg_ctl for its initscript
actions.

Sincerely,
Mr. Aaron W. Swenson

[1]
http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iF4EAREIAAYFAk3bAO0ACgkQCOhwUhu5AElmsQEAs5rqihVYnglG1l8tiAVE7LZ+
vGq8+YFxRrqlPEt0kQIA/0PIdnf9xlnNewPCZuMRk/uOOeMHBptcDMSTuaWI3QBU
=td0Z
-----END PGP SIGNATURE-----

Attachment Content-Type Size
pg_ctl-exit-status.patch text/plain 414 bytes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "Aaron W(dot) Swenson" <aaron(dot)w(dot)swenson(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change 'pg_ctl: no server running' Exit Status to 3
Date: 2011-06-03 16:11:30
Message-ID: BANLkTikPzQKDcg1ui4Pmi9ErQxD_czePpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, May 23, 2011 at 8:50 PM, Aaron W. Swenson
<aaron(dot)w(dot)swenson(at)gmail(dot)com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> According to Linux Standard Base Core Specification 3.1 [1], the exit
> status should be '3' when the server isn't running.
>
> I've attached a very simple patch that resolves this cosmetic issue,
> which applies to all branches.
>
> My initial search regarding other platforms has turned up nil. It looks
> like they just check for a zero or non-zero exit status.
>
> As for the necessity of the patch: Gentoo Linux uses pg_ctl in all of
> its initscript actions for PostgreSQL. I'd imagine that Gentoo is not
> the only distribution that takes advantage of pg_ctl for its initscript
> actions.

I'd be disinclined to back-patch this as it might break things for
people. But I see no harm in applying it to master, if nobody
objects...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Aaron W(dot) Swenson" <aaron(dot)w(dot)swenson(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change 'pg_ctl: no server running' Exit Status to 3
Date: 2011-06-03 20:09:00
Message-ID: 1307131740.32120.11.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On mån, 2011-05-23 at 20:50 -0400, Aaron W. Swenson wrote:
> According to Linux Standard Base Core Specification 3.1 [1], the exit
> status should be '3' when the server isn't running.
>
> I've attached a very simple patch that resolves this cosmetic issue,
> which applies to all branches.

If we're going to make the exit status meaningful, it should probably be
added to the documentation.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Aaron W(dot) Swenson" <aaron(dot)w(dot)swenson(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change 'pg_ctl: no server running' Exit Status to 3
Date: 2011-10-13 17:02:40
Message-ID: 201110131702.p9DH2eH21102@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On m?n, 2011-05-23 at 20:50 -0400, Aaron W. Swenson wrote:
> > According to Linux Standard Base Core Specification 3.1 [1], the exit
> > status should be '3' when the server isn't running.
> >
> > I've attached a very simple patch that resolves this cosmetic issue,
> > which applies to all branches.
>
> If we're going to make the exit status meaningful, it should probably be
> added to the documentation.

Patch attached and applied, with docs. I also cleaned up some C
comments, which are not in the attached patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
/rtmp/pg_ctl text/x-diff 1.4 KB