[SERVER-16081] init.d mongod startup script fails, with dirname message Created: 11/Nov/14 Updated: 06/Apr/23 Resolved: 23/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | 2.6.4, 2.6.5, 2.6.6 |
| Fix Version/s: | 2.6.7, 2.8.0-rc4 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Alberto Matsuchita | Assignee: | Ernie Hershey |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | Linux | ||||||||
| Backport Completed: | |||||||||
| Sprint: | BUILD 1 | ||||||||
| Participants: | |||||||||
| Description |
|
Hi, when I start mongodb 2.6.4.X and 2.6.5.X in LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch I receive the messages: Starting mongod: /usr/bin/dirname: extra operand `2>&1.pid' But MongoDb still starts. I´d like to know if there is a workaround or some correction and if these message causes no problem. Thanks in advance. Alberto |
| Comments |
| Comment by Githook User [ 06/Jan/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}Message: (cherry picked from commit 6105f06402fe1e7578d41f3e4e583a1476ef2455) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Smowtion [ 24/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Mongodb 2.64 not work with the bug fix, but 2.6.6 sucessfull | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 23/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ernie Hershey [ 23/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tested on these OS's
I skipped sles because it uses a different init script daemon wrapper which doesn't support or need the --check option. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ernie Hershey [ 23/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm going to test the fix on these platforms to verify:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ville-Pekka Vainio [ 19/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just a note that currently mongod does not even start on CentOS/RHEL 6.6 without the proposed patch. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 18/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the additional information mvatanen. All, this ticket has already been confirmed as a bug (indicated by the "Needs Triage" fixVersion) and will be included in the planing for future releases. Feel free to watch it to receive updates. Regards, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mikko Vatanen [ 16/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We have the same issue with MongoDB v2.6.5. Both CentOS 6.6 (Final) and RHEL 6.6 (Santiago) are affected. Tracing /etc/init.d/mongod shows that parsing $base variable is failing at /etc/init.d/functions:421.
This causes dirname command at /etc/init.d/functions.py:151 to print error message:
Here is test case for the $base variable:
Setting the $base variable is failing because expansion pattern does not expect any slash after "/usr/bin/mongod" part. Fortunately the previously proposed patch
Test run with patched version:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Wahyu Kristianto [ 15/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If I remove this ">/dev/null 2>&1", mongod work. But, get this message :
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 15/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
kristories, in order to determine what's causing this error message we'll need some more information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Wahyu Kristianto [ 15/Dec/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Ramon,
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alberto Matsuchita [ 18/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you very much for your return and support. Alberto | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 17/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for additional information amatsuchita. The error message you're seeing is harmless and you can safely ignore it. The message appears because /etc/init.d/mongod launches mongod in a way that doesn't agree with what the daemon function expects, and daemon complains about it. There's another consequence of this issue, and is that RedHat's init scripts can't check whether mongod is already running. If one tries to launch a second mongod with the same configuration file the system should just ignore the request and continue quietly, but in this case an error is produced – since the system can't tell that mongod is already running it tries to launch a second one, but mongod finds that there's another mongod process running on the same database path and aborts with an error. This error is passed back to the system and it's visible to the user. That being said, the total user impact is minimal, and mostly cosmetic. To get rid of the error, a possible workaround is to edit /etc/init.d/mongod and replace:
with
Please note that this workaround still doesn't 100% conform to daemon's spec, and it may get overwritten when you upgrade to the next version of MongoDB. We're keeping this ticket to investigate what can we do to improve the integration with RedHat's init.d functions. Regards, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alberto Matsuchita [ 17/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi. I have attached the command execution outputs. Thank you | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 14/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
amatsuchita, nothing looks out of place in the files you sent. Can you please run the following as root:
and paste the output on this ticket? Hopefully we'll be able to see where spurious message is coming from. Thanks, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alberto Matsuchita [ 12/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
/etc/sysconfig/mongod renamed to mongod.txt (it is the original. nothing was added). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 11/Nov/14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you please paste the contents of /etc/mongod.conf and /etc/sysconfig/mongod? If you're using a custom configuration file, please send that instead of mongod.conf. Thanks, |