[SERVER-6008] numactl in debian init script seems to be problematic Created: 05/Jun/12  Updated: 11/Jul/16  Resolved: 05/Aug/13

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 2.1.1, 2.2.5, 2.4.5, 2.5.1
Fix Version/s: 2.4.7, 2.5.2

Type: Bug Priority: Minor - P4
Reporter: Michael A. Fiedler Assignee: Ernie Hershey
Resolution: Done Votes: 4
Labels: initscript
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File init.d.patch     File mongodb.debian.init    
Issue Links:
Duplicate
is duplicated by SERVER-8774 mongodb is uninstallable on Debian Sq... Closed
is duplicated by SERVER-8565 debian/init.d does not work when numa... Closed
is duplicated by SERVER-7575 Debian start-up script in 10gen repos... Closed
is duplicated by SERVER-7737 Error in init.d with numactl command ... Closed
is duplicated by DOCS-1801 Comment on: "manual/tutorial/install-... Closed
Related
related to SERVER-8774 mongodb is uninstallable on Debian Sq... Closed
related to SERVER-6721 Enable to set the NUMA mode through /... Closed
is related to SERVER-7268 Add numactl to upstart scripts Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Participants:

 Description   
Issue Status as of December 16th, 2013

ISSUE SUMMARY
Mongod fails to start via init script in Debian if numactl is also installed.

USER IMPACT
If numactl is installed on a Debian system along with mongod, the init script will fail to start mongod. This issue is present in versions of MongoDB between v2.2.0 and v2.4.6, inclusive.

SOLUTION
Fix command line construction logic in init script.

WORKAROUNDS
Option 1) Uninstall numactl.
Option 2) Manually set the $NUMACTL variable to the empty string ("") in the mongod init script.

PATCHES
Production release v2.4.7 contains the fix for this issue, and production release v2.6.0 will contain the fix as well.

Original Description

It looks like the wrapper function for numactl here: https://github.com/mongodb/mongo/blob/master/debian/init.d#L67-74 doesn't work with the start-stop-daemon here: https://github.com/mongodb/mongo/blob/master/debian/init.d#L129-135

One solution could be to test for the existence of numa, and pass the full command to --exec.



 Comments   
Comment by auto [ 02/Oct/13 ]

Author:

{u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}

Message: SERVER-6008 move '--' out of DAEMON_OPTS rvalue
Branch: v2.4
https://github.com/mongodb/mongo/commit/4a34704bfa393b7a52b64a447a9c735bafe52782

Comment by auto [ 02/Oct/13 ]

Author:

{u'username': u'Aricg', u'name': u'Aricg', u'email': u'actual@aricgardner.com'}

Message: SERVER-6008 put the logic for DAEMON_OPTS= and – into the "if which numactl"

I hope this is correct, I have signed the contributor's agreement.

Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
Branch: v2.4
https://github.com/mongodb/mongo/commit/95342c1fb48e145b7f8a7e46c4fcc79d8bf0f1a0

Comment by auto [ 31/Jul/13 ]

Author:

{u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}

Message: SERVER-6008 move '--' out of DAEMON_OPTS rvalue
Branch: master
https://github.com/mongodb/mongo/commit/878cc4e5c93ce66b06f66bc80038a3d55a514226

Comment by auto [ 31/Jul/13 ]

Author:

{u'username': u'Aricg', u'name': u'Aricg', u'email': u'actual@aricgardner.com'}

Message: SERVER-6008 put the logic for DAEMON_OPTS= and – into the "if which numactl"

I hope this is correct, I have signed the contributor's agreement.

Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/188a0237bdbb84d308373f024a9a43e7d4715ef4

Comment by Michael Loftis [ 14/Jun/13 ]

Fixed init script that actually works, and behaves as intended and expected.

Comment by Michael Loftis [ 14/Jun/13 ]

Really, you need to remove --exec altogether as it is most emphatically NOT doing what you think it is, or at the very least has side effects that are completely unintended in this case. What you want is to forget about --exec in the startup case (and in the stop case too!) as it will try to find other processes with the exe and not start (or stop them too) if they exist. Granted on a production node you shouldn't run into this but on development, it could be pretty annoying. Use --startas instead during the start case, and remove --exec from the stop case. When numactl is available use --startas $NUMACTL and when numactl isn't available, just use the daemon.

I'll attach a fixed init script that works with and without numactl, and doesn't accidentally clobber other side by side mongo instances to this ticket.

Comment by Mario Splivalo [ 27/Feb/13 ]

Currently, mongodb is uninstallable without manual intervention on Debian Squeeze.

A patch provided is fixing that.

Generated at Thu Feb 08 03:10:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.