Use mongod --fork instead of mongod &. The former allows mongo to run even when
the terminal is killed. It is the proper way to start mongo in background.