[OpenSIPS-Users] Port to connect to Postgres DB when running "opensipsdbctl create"

Mariana Arduini marianarduini at gmail.com
Tue Apr 10 22:55:57 CEST 2012


Hello all,

I was trying to run "opensipsdbctl create" on machine 192.168.16.40 with
the following entries in file opensipsctlrc:

DBENGINE=PGSQL
DBHOST=192.168.16.51
DBNAME=opensips
DBRWUSER=opensips
DBRWPW=\"opensips\"
.
.
.

The postgres server in host 192.168.16.51 is running on port 6001 instead
of 5432 (default port). Here is the output:

# opensipsdbctl create

INFO: creating database opensips ...

psql: could not connect to server: Connection refused

                Is the server running on host "192.168.16.51" and accepting

                TCP/IP connections on port 5432?


I checked the command used to connect to the postgres server when running
"opensipsdbctl create" and this is what I found in file opensipsdbctl.pgsql:


CMD="psql -q -h $DBHOST -U $DBROOTUSER "

DUMP_CMD="pg_dump -h $DBHOST -U $DBROOTUSER -c"


There is no "-p" option there.  I've changed the files to include the port
as following:


* opensipsctlrc:


 DBENGINE=PGSQL
DBHOST=192.168.16.51
*DBPORT=6001*
DBNAME=opensips
DBRWUSER=opensips
DBRWPW=\"opensips\"
.
.
.

* script opensipsdbctl.pgsql

**

CMD="psql -q -h $DBHOST  *-p $DBPORT* -U $DBROOTUSER"

DUMP_CMD="pg_dump -h $DBHOST *-p $DBPORT* -U $DBROOTUSER -c"


After few simple tests, it went fine. I'm concerned about any side effects
those changes could cause or if there is any other file that needs to be
changed the same way.


Is there any main reason why that "-p" option is missing? Is it mandatory
to have the opensips database running on the default port or is this
something we can change in order to remove that limitation?


Thanks a lot in advance!


Mariana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120410/e5df4887/attachment-0001.htm>


More information about the Users mailing list