Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue with Systemd service unit. Possibly only effects newer versions of MongoDB #90

Open
ShaunMaher opened this issue Sep 23, 2020 · 1 comment
Labels

Comments

@ShaunMaher
Copy link

Your setup

Formula commit hash / release tag

6977ccf

Versions reports (master & minion)

Pillar / config used

wanted:
  database:
    - mongod
    - shell
pkg:
  deps:
    - python3-pip
  database:
    mongod:
      version: 4.4.1
      use_upstream: 'archive'
      config:
        storage:
          dbPath: /var/lib/mongodb/mongod

Bug details

Describe the bug

I'm attempting to install a reasonably standard installation of MongoDB on Ubuntu 20.04 using this formula (obviously).

Unless I'm mistaken, with MongoDB 4.4.1 (the latest version at the time of writing), is not using the conf file that this formula creates in /etc/mongodb/mongod.conf. The symptom it presents is the daemon failing to start and the following error in the system journal:

"NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."

If you edit the systemd unit file in /lib/systemd/system/mongod.service and change the ExecStart= line to the following, it works:

ExecStart=/usr/local/mongodb/mongod-4.4.1/bin/mongod -f /etc/mongodb/mongod.conf

I'm happy to create a PR that adds the command line argument but I'm not sure of:

  • Does this only effect mongodb versions newer than some version? If so, Which version?
  • I don't have access to systems other than Ubuntu to test on. If the GitHub automated testing handles other platforms, great, if not, I'll need some help testing.

Steps to reproduce the bug

Expected behaviour

Attempts to fix the bug

Additional context

@ShaunMaher ShaunMaher added the bug label Sep 23, 2020
@noelmcloughlin
Copy link
Member

Looks like all Linux is impacted:

{%- if grains.kernel == 'Linux' %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants