Mongod under Ubuntu quits the service by pressing ctrl +c in the shell interface.

  mongodb, question

Linux command window directly Ctrl+C exits, then mongod will be closed

$ mongod
 2016-02-01T17:51:24.743+0800 I CONTROL  [initandlisten] MongoDB
 starting : pid=19587 port=27017 dbpath=/data/db 64-bit host=iZ28krk4xlkZ

Run in a configuration that uses Mongoose –fork does not work

mongod --fork
 BadValue --fork has to be used with --logpath or --syslog
 try 'mongod --help' for more information

According to the prompt, modify as follows or error

mongod --fork --logpath '/data/log'
 about to fork child process, waiting until server is ready for connections.
 forked process: 28117
 ERROR: child process failed, exited with error number 1

Use officialInstallation documentation
How to Run mongodb Service Persistently

nohup mongod &