Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6553199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:33:12+00:00 2026-05-25T12:33:12+00:00

the standard upstart script that comes with mongodb works fine: # Ubuntu upstart file

  • 0

the standard upstart script that comes with mongodb works fine:

# Ubuntu upstart file at /etc/init/mongodb.conf

limit nofile 20000 20000

kill timeout 300 # wait 300s between SIGTERM and SIGKILL.

pre-start script
    mkdir -p /var/lib/mongodb/
    mkdir -p /var/log/mongodb/
end script

start on runlevel [2345]
stop on runlevel [06]

script
  ENABLE_MONGODB="yes"
  if [ -f /etc/default/mongodb ]; then . /etc/default/mongodb; fi
  if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --start --quiet --chuid mongodb --exec  /usr/bin/mongod -- --config /etc/mongodb.conf; fi
end script

if i want to run a second instance of mongod i thought i just copy both /etc/mongodb.conf -> /etc/mongodb2.conf and /etc/init/mongodb.conf -> /etc/init/mongodb2.conf and change the std port in the first conf-file. then adjust the script above to start with the newly created /etc/mongodb2.conf.

i can then just say start mongodb2and the service starts … but it is killed right after starting. what do i change, to get both processes up and running?

 # Ubuntu upstart file at /etc/init/mongodb2.conf

limit nofile 20000 20000

kill timeout 300 # wait 300s between SIGTERM and SIGKILL.

pre-start script
    mkdir -p /var/lib/mongodb2/
    mkdir -p /var/log/mongodb2/
end script

start on runlevel [2345]
stop on runlevel [06]

script
  ENABLE_MONGODB="yes"
  if [ -f /etc/default/mongodb ]; then . /etc/default/mongodb; fi
  if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --start --quiet --chuid mongodb --exec  /usr/bin/mongod -- --config /etc/mongodb2.conf; fi
end script
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:33:13+00:00Added an answer on May 25, 2026 at 12:33 pm

    i couldn’t get the “standard” upstart script to work (as described above), so i changed it like this:

    # Ubuntu upstart file at /etc/init/mongodb.conf
    
    limit nofile 20000 20000
    
    kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
    
    pre-start script
        mkdir -p /var/lib/mongodb/
        mkdir -p /var/log/mongodb/
    end script
    
    start on runlevel [2345]
    stop on runlevel [06]
    
    script
    
      exec sudo -u mongodb /usr/bin/mongod --config /etc/mongodb.conf
    
    end script
    

    and if you want to run other instances of mongodb just copy the *.conf files and make the changes to /etc/mongodb2.conf and /etc/init/mongodb2.conf

    # Ubuntu upstart file at /etc/init/mongodb2.conf
    
    limit nofile 20000 20000
    
    kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
    
    pre-start script
        mkdir -p /var/lib/mongodb2/
        mkdir -p /var/log/mongodb2/
    end script
    
    start on runlevel [2345]
    stop on runlevel [06]
    
    script
    
      exec sudo -u mongodb /usr/bin/mongod --config /etc/mongodb2.conf
    
    end script
    

    i think the only thing that is not working is restart mongodb – you have to stop and then start again …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The standard specifies (23.4.4.2:5, etc.) that constructing all four ordered associative containers ( map
The standard explicitly states that main has two valid (i.e., guaranteed to work) signatures;
In standard library, I found that namespace std is declared as a macro. #define
standard C lib: int fputc(int c , FILE *stream); And such behaviors occured many
Using standard php5-pgsql driver it results to me that, at least with the default
The standard HTTP Authentication for SOAP passed the password etc in cleartext,and I'm looking
The standard Ruby library io/wait provides a method on IO objects ready? that returns
Standard WPF combo box has the type in functionality. That is: when combo box
That standard demos for ASP.NET MVC 3 web site user managements include the following
The standard behaviour is, that as soon as the day reaches 31 the step-up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.