Description of problem: There is an error on line 163 when executing /etc/init.d/mongod status # /etc/init.d/mongod status mongod (pid 2492) is running... /etc/init.d/mongod: line 163: [: missing `]' /etc/init.d/mongod: line 163: 127.0.0.1: command not found listening on 127.0.0.1:27017 connection test successful Version-Release number of selected component (if applicable): The package version used is mongodb-server-2.4.6-5.el6ost.x86_64 How reproducible: /etc/init.d/mongdb status Steps to Reproduce: 1./etc/init.d/mongdb status 2. 3. Actual results: [root@rhos4-os2-controller01 ~]# /etc/init.d/mongod status mongod (pid 2492) is running... /etc/init.d/mongod: line 163: [: missing `]' /etc/init.d/mongod: line 163: 127.0.0.1: command not found listening on 127.0.0.1:27017 connection test successful Expected results: The status of mongodb Additional info:
I'm amazed how these simple typos are able to sneak in :-)
Hi Flavio, yes, its ops 4, i reproduced it in my test environments, i didn't tried yet on osp 5. give me 5 minuts and I will try on osp 5
As indicated OSP is working ok and the fix doesn't look complicated. /etc/init.d/mongod: line 163: [: missing `]' By the way this is also visible at https://bugzilla.redhat.com/show_bug.cgi?id=1112416#c8
@Eduard the version of the init script I have doesn't seem to match the error reported. Would you mind uploading yours?
Please provide the initscript as requested by Flavio.
Haïkel/Flavio - The initscript Eduard refered to is what ships in 2.4.6-5.el6ost. The problem reported here is resolved w/ the following change in the 2.4.6-8.el6ost initscript: 163c163,165 < [ -z "$a" || "$a" = "0.0.0.0" ] && a=127.0.0.1 --- > # mongodb defaults to INADDR_ANY, so use that > # if not set in the config file > [ -z "$a" ] && a=0.0.0.0 Basically the issue is that 2.4.6-8.el6ost isn't available in the osp-4 channels.
@Dave: thanks for your feedback, I'll ship the fix asap.
Lon tagged the build from RHOS5/EL6 so it should be fixed.
verified in: # rpm -qa |grep mongodb mongodb-2.4.6-8.el6ost.x86_64 libmongodb-2.4.6-8.el6ost.x86_64 mongodb-server-2.4.6-8.el6ost.x86_64 # /etc/init.d/mongod status mongod (pid 22911) is running... listening on 127.0.0.1:27017 connection test successful [root@opens-vdsb ~(keystone_admin)]# vim /etc/init.d/mongod [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod stop Stopping mongod: [ OK ] [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod start Starting mongod: [ OK ] Waiting for mongod to become available: [ OK ] [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod (pid 18023) is running... listening on 127.0.0.1:27017 connection test successful [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod (pid 18023) is running... listening on 127.0.0.1:27017 connection test successful [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod (pid 18023) is running... listening on 127.0.0.1:27017 connection test successful [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod (pid 18023) is running... listening on 127.0.0.1:27017 connection test successful [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod stop Stopping mongod: [ OK ] [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod stop [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod stop [root@opens-vdsb ~(keystone_admin)]# [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod is stopped [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod start Starting mongod: [ OK ] Waiting for mongod to become available: ^[[A [ OK ] [root@opens-vdsb ~(keystone_admin)]# /etc/init.d/mongod status mongod (pid 18192) is running... listening on 127.0.0.1:27017 connection test successful
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0885.html