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 library open function works both as a function: f = open('file.txt') print(type(f))
The standard model has been that OpenGL is for professional apps (CAD) and Direct3D
Using standard mysql functions is there a way to write a query that will
standard C lib: int fputc(int c , FILE *stream); And such behaviors occured many
The standard HTTP Authentication for SOAP passed the password etc in cleartext,and I'm looking
In Standard Pascal what are considered simple types? Are these the only types that
The standard Ruby library io/wait provides a method on IO objects ready? that returns
The standard SAP MM advice is that only two periods can be open simultaneously
The standard behaviour is, that as soon as the day reaches 31 the step-up
Standard password security involves generating a random salt for each user, somehow combining that

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.