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 8892039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:53:42+00:00 2026-06-14T22:53:42+00:00

Environment: 3.4.9-gentoo mongodb (OpenRC) 0.9.8.4 (Gentoo Linux) if I use mongod daemon to start

  • 0

Environment:

  • 3.4.9-gentoo
  • mongodb (OpenRC) 0.9.8.4 (Gentoo Linux)

if I use mongod daemon to start mongodb,the default db path is /data/db

But if I use /etc/init.d/mongodb script to start mongodb, the /etc/conf.d/mongdb write the default db path is /var/lib/mongodb,

I am puzzled that why the db path is not the same?

  • 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-06-14T22:53:43+00:00Added an answer on June 14, 2026 at 10:53 pm

    The default dbpath if you start MongoDB without a configuration file is /data/db.

    Your init script (/etc/init.d/mongodb) is starting mongodb with the --config (aka -f) option and a path to a config file to use (/etc/conf.d/mongodb).

    If you look at the contents of your /etc/config.mongodb configuration file, you should see the dbpath setting with the /var/lib/mongodb directory path that overrides the default. In this case the maintainer of your MongoDB install package has decided that /var/lib is the most appropriate default directory for data files. Generally this is done to be more consistent with the default locations used by other packages in your distribution; the MongoDB data files can live anywhere on your filesystem.

    You can also check for any settings that have been overridden by your configuration file in the mongo shell using:

     getCommandLineOpts()
    

    The output will be similar to:

    {
        "argv" : [
            "mongod",
            "--dbpath",
            "/var/lib/mongodb"
        ],
        "parsed" : {
            "dbpath" : "/var/lib/mongodb"
        },
        "ok" : 1
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Environment: hudson/sonar/maven2 in ubuntu locally with default parameters And I got the log from
(Environment: gcc/g++ 4.6.1 in -std=gnu++0x mode on Linux 3.0 / x86_64...) #include <stdlib.h> #include
I want to build a lightweight linux configuration to use for development. The first
Environment.SpecialFolder.CommonApplicationData *returns C:\Documents and Settings\All Users\Application Data under XP that is writeable for all
Environment: xcode 3.2.1, document-based core-data application. I have a document-based cocoa app which uses
Environment: Android 2.3.3 with Google API I know this is kind of long, but
Environment: Linux 2.6.32 (RHEL 6.3) on x86_64 with gcc 4.4.6 Background: I am running
Environment: 3 GB data file with a 28 byte SHA-1 checksum appended to the
Environment: linux x64, compiler gcc 4.x Project has following structure: static library slib --
Environment: Visual studio 2012, MvcScaffolding I'm new to MvcScaffolding and Powershell but what I'm

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.