[SERVER-20947] 'service mongod stop' does not stop mongod on amazon AMI Created: 15/Oct/15  Updated: 24/Nov/15  Resolved: 23/Nov/15

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 3.0.7
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Rentaro Matsukata Assignee: Ernie Hershey
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-21209 PIDFILEPATH computation in init scrip... Closed
Operating System: ALL
Steps To Reproduce:

Following the directions on http://docs.mongodb.org/manual/tutorial/install-mongodb-on-amazon/ I installed mongod onto Amazon's Linux AMI (ami-e3106686). As far I know I followed the directions.

After provisioning the Linux machine (ami-e3106686) I copied the following text into the mongodb repo file and installed mongodb:

[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1

then

sudo yum install -y mongodb-org

then

sudo service mongod start

then

sudo service mongod stop

Participants:

 Description   

Following the directions on http://docs.mongodb.org/manual/tutorial/install-mongodb-on-amazon/ I ended up with a mongod installation that can't be stopped using:

sudo service mongod stop

Even though it says it's been stopped it's still running.

This is due to the usage of binary pidofproc which doesn't come installed with the Amazon Linux AMI ami-e3106686

PS this is my first Jira issue I posted so please let me know if more information is needed.

Thanks



 Comments   
Comment by Ramon Fernandez Marina [ 24/Nov/15 ]

Thanks for confirming the workaround Ovsyanka, much appreciated.

Comment by Igor Deyashkin [X] [ 24/Nov/15 ]

I have the same issue and your solution works. Thank you.

Comment by Ramon Fernandez Marina [ 23/Nov/15 ]

Hi freefood89, apologies for the long delay in getting back to you. pidofproc is a shell function in /etc/rc.d/init.d/functions. This is part of the initscripts packages, which is required to run the system, so that's not the issue.

The reason mongod is not stopped correctly is because SERVER-21209, which has been fixed in recent versions. Until 3.0.8 is released there's an easy workaround: in /etc/mongod.con make sure there are no comments after the definition for pidFilePath. In other words, change this:

pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile

to this:

# location of pid file
pidFilePath: /var/run/mongodb/mongod.pid

Please give this a try and let us know if the issue still persists.

Thanks,
Ramón.

Comment by Ramon Fernandez Marina [ 15/Oct/15 ]

Thanks for the detailed report freefood89, we're investigating.

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