user3690202
user3690202

Reputation: 4045

How to get mongodb to start at boot time in Ubuntu

I have a stock install of Ubuntu 14, installed a few weeks ago. I installed mongodb with apt-get. When I run

sudo service mongodb start

then the service runs correctly and I can access all the mongodb goodness. However, whenever I reboot it will not start automatically. I have tried running update.rc or whatever it is called, and it claims to run successfully however still no luck.

Is this a known issue? How can I diagnose it? And I guess, most importantly, how can I make it start at reboot?

Upvotes: 0

Views: 4260

Answers (1)

Ashoka Lella
Ashoka Lella

Reputation: 6729

For adding any service to startup try:

sudo update-rc.d <service_name> defaults

If that doesn't work you can add your start command in /etc/rc.local before the line exit 0

Upvotes: 1

Related Questions