M BUZZ CRAZE NEWS
// general

How can I stop mongodb from starting on system boot

By John Parsons

I installed mongodb for learning purpose, the problem I am facing is that it starts on system boot and consume resources even if not being used. I want it to be removed from system boot, how can I do this?

3

5 Answers

I can't test it at the moment, but I think this should work

 sudo update-rc.d mongodb disable

If this is not enough try this

 sudo update-rc.d -f mongodb remove
1

This is borrowed from this answer:

echo manual | sudo tee /etc/init/mongod.override
1

This worked for me and I'm using Ubuntu 18.04:

sudo systemctl disable mongod
1

@davelupt's reference is great. However I guess the command should be

echo manual | sudo tee /etc/init/mongod.override

since the file for MongoDB under /etc/init is mongod.conf.

1

For Ubuntu 18 and above use

$ sudo systemctl stop mongod

For earlier versions

$ sudo service mongod stop

For MacOS:

$ brew services stop mongodb-community@4.2

For Windows, Open CMD as Admin:

sc.exe delete MongoDB

More info can be found here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy