Bug 123951 - enabling the daemon to listen on the network (suggestion)
enabling the daemon to listen on the network (suggestion)
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rh-postgresql (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-21 17:47 EDT by Matt Bradshaw
Modified: 2013-07-02 23:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-21 18:34:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Bradshaw 2004-05-21 17:47:51 EDT
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 18:34:38 EDT
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 16:25:27 EDT
doh.  i apologize for the above misinformation.  thank you for
correcting me.

Note You need to log in before you can comment on or make changes to this bug.