How to run mongod in the background on Linux

2,232 views
Skip to first unread message

Rafi B.

unread,
Feb 14, 2010, 8:52:30 AM2/14/10
to mongodb-user
Hi,
I'm a Windows user, and I'm trying to deploy my website which is using
MongoDB of course :) When I logon the server in ssh and run ./
mongod if I exit with CTRL+C or close PuTTy, mongod stops running.
Can somebody please help out a dumb Windows user ? :(

The server I'm running mongod is Redhat.

Eliot Horowitz

unread,
Feb 14, 2010, 8:55:47 AM2/14/10
to mongod...@googlegroups.com
--fork with --logpath should do it

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Rafi B.

unread,
Feb 14, 2010, 9:06:32 AM2/14/10
to mongodb-user
Thanks Eliot! Works perfect. And I just found it under "Running as a
daemon" at http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
I feel like such a newbie.

Thanks so much for your help though!


On Feb 14, 3:55 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> --fork with --logpath should do it
>

Rafi B.

unread,
Feb 14, 2010, 9:13:48 AM2/14/10
to mongodb-user
Can you recommend on a bash script to put in the rc.d (is it
rc.d? :)),
to automatically start MongoDB + repair the database if there was a
crash ?


On Feb 14, 4:06 pm, "Rafi B." <justr...@gmail.com> wrote:
> Thanks Eliot! Works perfect. And I just found it under "Running as a

> daemon" athttp://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo

Eliot Horowitz

unread,
Feb 14, 2010, 9:52:18 AM2/14/10
to mongod...@googlegroups.com
there are startup files for various distros
what distro are you using?

Randy Schnedler

unread,
Mar 11, 2010, 7:08:24 PM3/11/10
to mongodb-user
Eliot, is there a startup file for CentOS (64bit)?

I saw on the mailing list a sample from last year that uses nohup, but
mongo has changed since then -- e.g., we have the --fork option now.


On Feb 14, 8:52 am, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> there are startup files for various distros
> what distro are you using?
>

> On Sun, Feb 14, 2010 at 9:13 AM, Rafi B. <justr...@gmail.com> wrote:
> > Can you recommend on a bashscriptto put in the rc.d (is it


> > rc.d? :)),
> > to automatically start MongoDB + repair the database if there was a
> > crash ?
>
> > On Feb 14, 4:06 pm, "Rafi B." <justr...@gmail.com> wrote:
> >> Thanks Eliot! Works perfect. And I just found it under "Running as a
> >>daemon" athttp://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
> >> I feel like such a newbie.
>
> >> Thanks so much for your help though!
>
> >> On Feb 14, 3:55 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
>
> >> > --fork with --logpath should do it
>
> >> > On Sun, Feb 14, 2010 at 8:52 AM, Rafi B. <justr...@gmail.com> wrote:
> >> > > Hi,
> >> > > I'm a Windows user, and I'm trying to deploy my website which is using
> >> > > MongoDB of course :)   When I logon the server in ssh and run ./

> >> > >mongod  if I exit with CTRL+C or close PuTTy,mongodstops running.


> >> > > Can somebody please help out a dumb Windows user ? :(
>

> >> > > The server I'm runningmongodis Redhat.

Eliot Horowitz

unread,
Mar 12, 2010, 12:03:29 PM3/12/10
to mongod...@googlegroups.com
You can see whats in the rpm directory.
But this case will depend on getting those cleaned up:
http://jira.mongodb.org/browse/SERVER-534

Randy Schnedler

unread,
Mar 12, 2010, 1:34:23 PM3/12/10
to mongodb-user
Thanks for the pointer. Maybe these will be ready sometime soon since
Peter Halliday volunteered to fix them up.


On Mar 12, 11:03 am, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> You can see whats in the rpm directory.
> But this case will depend on getting those cleaned up:http://jira.mongodb.org/browse/SERVER-534
>

Reply all
Reply to author
Forward
0 new messages