public inbox for [email protected]  
help / color / mirror / Atom feed
services and pg_ctl
2+ messages / 2 participants
[nested] [flat]

* services and pg_ctl
@ 2015-07-28 08:36  James Sewell <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: James Sewell @ 2015-07-28 08:36 UTC (permalink / raw)
  To: pgsql-pkg-yum

Hello,

It seems that in some (recent? all?) versions of the PGDG Redhat/CentOS
RPMs pg_ctl and service (init.d) don't play well together.

As an example:


-bash-4.1$ id
uid=26(postgres) gid=26(postgres) groups=26(postgres),500(efm)
-bash-4.1$
-bash-4.1$ psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
-bash-4.1$
-bash-4.1$ pg_ctl start
server starting
-bash-4.1$ exit
logout
[root@centos6-soe /]#
[root@centos6-soe /]# service postgresql-9.4 status
postgresql-9.4 is stopped

It seems like this is because of pg_ctl and the init.d script using
different lockfiles / pidfiles. This can be fixed by doing the following:

   1. Making a directory for locks and pid files (in /var/lock/subsys and
   /var/run) and setting it to be owned by postgres
   2. Setting unix_socket_directories in postgresql.conf to use the lock
   directory by default.
   3. Setting external_pid_file in postgresql.conf to use the /var/run
   directory by default
   4. Setting the init.d script to write the lockfile in the same way
   pg_ctl does

Is this something that could change in the future (or is there a reason
this is a bad idea)? I'm happy to provide diffs to get to a working state
if that helps.

Cheers,


James Sewell,
PostgreSQL Team Lead / Solutions Architect
______________________________________


 Level 2, 50 Queen St, Melbourne VIC 3000

*P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099

-- 


------------------------------
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this 
email is free of viruses or other defects. If you have received this 
communication in error, you may not copy or distribute any part of it or 
otherwise disclose its contents to anyone. Please advise the sender of your 
incorrect receipt of this correspondence.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: services and pg_ctl
@ 2015-08-26 10:22  Devrim GÜNDÜZ <[email protected]>
  parent: James Sewell <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Devrim GÜNDÜZ @ 2015-08-26 10:22 UTC (permalink / raw)
  To: James Sewell <[email protected]>; pgsql-pkg-yum



Hi,

<snip>

On Tue, 2015-07-28 at 18:36 +1000, James Sewell wrote:
> Is this something that could change in the future (or is there a 
> reason this is a bad idea)? I'm happy to provide diffs to get to a 
> working state if that helps.

Well, I would love to see the patch. Seems useful to me.

Regards,

-- 
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR





-- 
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-08-26 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 08:36 services and pg_ctl James Sewell <[email protected]>
2015-08-26 10:22 ` Devrim GÜNDÜZ <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox