I'm (still) a novice on Linux, and trying to figure out how to make mongodb start when server boots on Linux?
I'm using Amazon EC2 "default" Linux instance (no Ubuntu).
You have to put a startup script into /etc/init.d
or one of those rc.x.d
folders (depending on the fact under which circumstances you want to start mongod).
So ideally you put a startup script into etc/init.d/ and symlink it to the appropriate rc.x.d folders. Those rc folders mean the following as of the supplied link at the bottom:
The startup script itself can be as easy as:
#!/bin/sh
/path/to/mongod #if you have mongod copied to some linux well known place you may only use mongod
To start a default configured mongod process, but you may want to configure it through additional parameters you can get from MongoDB - Command Line Parameters.
When you want to start mongodb only when a given user logs in you may want to add the startup script code into your .bash_profile
of the corresponding user.
More can be found in this thread: Where do you place shutdown scripts?