Bug 1063659 - init script does not respect options from /etc/sysconfig/mongod
Summary: init script does not respect options from /etc/sysconfig/mongod
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: mongodb
Version: 4.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: z3
: 4.0
Assignee: Flavio Percoco
QA Contact: Lon Hohberger
URL:
Whiteboard:
Depends On:
Blocks: 1066408 1100411
TreeView+ depends on / blocked
 
Reported: 2014-02-11 08:17 UTC by Fabio Massimo Di Nitto
Modified: 2014-05-22 18:52 UTC (History)
8 users (show)

Fixed In Version: mongodb-2.2.4-6.el6ost
Doc Type: Bug Fix
Doc Text:
Previously, the MongoDB initialisation script did not pick up system configuration because $OPTIONS was incorrectly specified in the `/etc/sysconfig/mongod` file. The script now correctly imports the MongoDB system configuration, and checks whether any of the environment configuration options have been set.
Clone Of:
Environment:
Last Closed: 2014-03-25 19:23:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Tiny additional fix (485 bytes, patch)
2014-03-11 18:07 UTC, Lon Hohberger
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0334 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform 4 Bug Fix and Enhancement Advisory 2014-03-25 23:22:45 UTC

Description Fabio Massimo Di Nitto 2014-02-11 08:17:25 UTC
[root@rhos4-mongodb1 ~]# cat /etc/sysconfig/mongod  
OPTIONS="--quiet -f /etc/mongodb.conf"


[root@rhos4-mongodb1 ~]# grep -i options /etc/init.d/mongod 
options="$MONGODB_OPTIONS -f /etc/mongodb.conf"
    daemon --pidfile=${pidfile} --user mongodb "$exec --quiet $options run >> $logfile 2>&1 &"

as you can see, OPTIONS from mongod can never be applied to $options.

Also please note that --quiet is harcoded when spawning the daemon.

Comment 10 Lon Hohberger 2014-03-11 18:00:21 UTC
Starting mongodb with 2.2.4-5 fails; the logs contain:

error command line: multiple_occurrences
use --help for help

This is because the startup init script needs to be tweaked to not have "--quiet" since it's provided in $MONGODB_OPTIONS.

Comment 11 Lon Hohberger 2014-03-11 18:01:41 UTC
[root@rhos init.d]# mongod --quiet --quiet -f /etc/mongodb.conf run
error command line: multiple_occurrences
use --help for help

Comment 12 Lon Hohberger 2014-03-11 18:07:50 UTC
Created attachment 873217 [details]
Tiny additional fix

Comment 13 Lon Hohberger 2014-03-11 19:11:41 UTC
[root@rhos mongodb]# cat /etc/sysconfig/mongod
MONGODB_OPTIONS="--quiet -f /etc/mongodb.conf"
[root@rhos mongodb]# service mongod start
Starting mongod:                                           [  OK  ]
[root@rhos mongodb]# ps auwwx | grep mongo | grep -v grep
mongodb  14785  1.2  0.8 786604 34144 ?        Sl   15:07   0:00 /usr/bin/mongod --quiet -f /etc/mongodb.conf run
[root@rhos mongodb]# service mongod status
mongod (pid  14785) is running...
[root@rhos mongodb]# service mongod stop
Stopping mongod:                                           [  OK  ]
[root@rhos mongodb]# service mongod status
mongod is stopped

(change mongod)

[root@rhos mongodb]# cat /etc/sysconfig/mongod
MONGODB_OPTIONS="-f /etc/mongodb.conf"
[root@rhos mongodb]# service mongod start
Starting mongod:                                           [  OK  ]
[root@rhos mongodb]# ps auwwx | grep mongo | grep -v grep
mongodb  14974  1.1  0.8 786636 32564 ?        Sl   15:10   0:00 /usr/bin/mongod -f /etc/mongodb.conf run
[root@rhos mongodb]# service mongod status
mongod (pid  14974) is running...
[root@rhos mongodb]# service mongod stop
Stopping mongod:                                           [  OK  ]
[root@rhos mongodb]# service mongod status
mongod is stopped


I did not check upgrades.

Comment 15 errata-xmlrpc 2014-03-25 19:23:55 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.

http://rhn.redhat.com/errata/RHBA-2014-0334.html


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