Bug 123951

Summary: enabling the daemon to listen on the network (suggestion)
Product: Red Hat Enterprise Linux 3 Reporter: Matt Bradshaw <mbrad1>
Component: rh-postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: hhorak
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-21 22:34:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matt Bradshaw 2004-05-21 21:47:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114 Epiphany/1.0.4

Description of problem:
at the present, the only way to enable listening on the network is to
modify postgres' (ie: rhdb) init script.  as it stands, apps
connecting to the server must be local.  (i assume it's using a unix
dgram socket, or pipe or something.  anyhoo, besides the point.)

[details for those interested:  on line 171 of /etc/init.d/rhdb, we
are required to append a "-i" to the options of postmaster (using
pg_ctl).]

this isn't too terribly difficult to do, but a problem does arise when
the package is upgraded.  upon (automatic) upgrade, the init script
gets overwritten and your necessary changes are erased.  in addition,
since the package restarts itself upon upgrade, any apps that depend
on a network connection to the database break.

i believe it'd be easy to rememdy this.

the underlying problem is simply that you haven't separated
configuration from the application itself.  you could delegate options
to the postmaster daemon in an environment variable within
/etc/sysconfig/rhdb (similiar to the samba package).  or you could be
more elaborate and have a NETLISTEN=yes (similar to the sendmail
package's DAEMON=yes) and have rhdb's init script account for such
configuration.

baking this into the package would be the Right Thing to do, i believe.

Version-Release number of selected component (if applicable):
rh-postgresql-server-7.3.6-1

How reproducible:
Always

Steps to Reproduce:
1. change the init script to allow fairly common requirement of
network-listening
2. upgrade the package (sometimes automatically even)

Actual Results:  now there is no more ability to listen on the network

Expected Results:  well... i expected what happened, but it'd be much
nicer to have the init script extended to account for this certainly
common configuration.

Additional info:

Comment 1 Tom Lane 2004-05-21 22:34:38 UTC
It is not true at all that you have to modify the initscript to enable
TCP connections.  The preferred way to do this is to set tcpip_socket
to true in postgresql.conf.  AFAIK, other than the initial
specification of data directory there is no need to put anything at
all on the postmaster command line; all else can be set from the
config file.

Comment 2 Matt Bradshaw 2004-06-01 20:25:27 UTC
doh.  i apologize for the above misinformation.  thank you for
correcting me.