Bug 1158076 - error in /etc/init.d/mongod status code
Summary: error in /etc/init.d/mongod status code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: mongodb
Version: 4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z6
: 4.0
Assignee: hguemar
QA Contact: Ami Jeain
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-28 13:54 UTC by Eduard Barrera
Modified: 2023-02-22 23:02 UTC (History)
14 users (show)

Fixed In Version: mongodb-2.4.6-8.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-23 13:03:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-7795 0 None None None 2022-08-10 09:48:32 UTC
Red Hat Knowledge Base (Solution) 2586101 0 None None None 2016-08-29 12:51:18 UTC
Red Hat Product Errata RHBA-2015:0885 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Bug Fix and Enhancement Advisory 2015-04-23 17:03:29 UTC

Description Eduard Barrera 2014-10-28 13:54:02 UTC
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:

Comment 2 Felipe Alfaro Solana 2014-10-28 16:05:13 UTC
I'm amazed how these simple typos are able to sneak in :-)

Comment 4 Eduard Barrera 2014-10-31 13:29:00 UTC
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

Comment 6 Pablo Caruana 2014-11-21 12:26:16 UTC
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

Comment 7 Flavio Percoco 2014-11-25 08:23:20 UTC
@Eduard the version of the init script I have doesn't seem to match the error reported. Would you mind uploading yours?

Comment 14 Haïkel Guémar 2015-04-03 17:08:54 UTC
Please provide the initscript as requested by Flavio.

Comment 15 Dave Maley 2015-04-06 15:50:11 UTC
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.

Comment 16 hguemar 2015-04-09 14:48:29 UTC
@Dave: thanks for your feedback, I'll ship the fix asap.

Comment 17 hguemar 2015-04-10 16:22:30 UTC
Lon tagged the build from RHOS5/EL6 so it should be fixed.

Comment 19 Ami Jeain 2015-04-19 14:42:42 UTC
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

Comment 22 errata-xmlrpc 2015-04-23 13:03:51 UTC
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


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