Menu

#756 tango-db bug if /etc/tangorc contains commented TANGO_HOST entries

open
debian (1)
Miscellaneous
5
2015-11-27
2015-11-27
Andy Gotz
No

Hi,

there is a small bug in the tango-db startup script. If you have multiple entries of TANGO_HOST in the /etc/tangorc file then they are all taken into account even if the lines are commented out. This leads to the HOST and CANON_HOST variables in the tango-db file being incorrectly detected.

Example

if your /etc/tangorc contains (ignore the line numbers) :

1:#TANGO_HOST=pcandy:10000
2:TANGO_HOST=localhost:10000

Then the tango-db script will detect

HOST = pcandy localhost
CANON_HOST = pcandy localhost

Notice the double host names. This causes the DataBaseds to starrt listening on the wrong interface sometimes.

Workaround

The workaround today is to remove the commented line(s) from /etc/tangorc:

1.TANGO_HOST=localhost:10000

Bug Fix

A fix would be to change the grep command in tango-db to filter only lines starting with TANGO_HOST e.g.

PORT=grep ^TANGO_HOST $CONFFILE | awk -F ":" '{print $2}'
HOST=grep ^TANGO_HOST $CONFFILE | awk -F ":" '{print $1}' | awk -F "=" '{print $2}'
CANON_HOST=grep ^TANGO_HOST $CONFFILE | awk -F ":" '{print $1}' | awk -F "=" '{print $2}' | awk -F "." '{print $1}'
e

It would be great if this could be fixed for future debian packages.

Thanks

Andy

Discussion


Log in to post a comment.

MongoDB Logo MongoDB