3

Ubuntu 15.10

I am TOTALLY confused by all the posts about the new service loaders, and rather concerned that Mongo don't seem to think that it is their issue to solve. Here is one of several posts that suggest it is nearly impossible, except with manual interventions. (A solution from 2011 is not a solution given the current mix of technology used by Ubuntu and Mongo.)

And yet, what I know is that mongod no longer starts at boot time, but that if I open a console and run sudo service mongod start, then it works.

What is the simplest way to automate this during the initial bootup?

Hotbelgo
  • 673
  • See this -> http://askubuntu.com/questions/419169/how-do-i-make-a-sudo-command-start-at-start-up-with-a-1-minute-delay – Parto Dec 03 '15 at 08:05
  • 1
    Pointing the questioner at even more woefully outdated and non-Ubuntu-init-system information (for Ubuntu 11 and for rc.local of all things!) really doesn't help matters when the the questioner identifies this as part of the very problem, Parto. See http://askubuntu.com/a/617869/43344, https://jira.mongodb.org/browse/SERVER-17742, and http://unix.stackexchange.com/a/187540/5132 for some of the many discussions of starting MongoDB with systemd and upstart. My experience, for what it's worth, is that "nearly impossible" should read "fairly easy". – JdeBP Dec 05 '15 at 19:48

2 Answers2

3

The simplest way is to use update-rc.d. Enter following command to add mongod to system services means starting at boot time:

sudo update-rc.d mongod defaults
Tung Tran
  • 3,945
0

The correct command is:

sudo update-rc.d mongodb defaults
Eliah Kagan
  • 117,780