Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23516

Using apt-get update chowns user to mongodb

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.4.10, 3.5.8
    • Component/s: Packaging
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.4, v3.2, v3.0
    • Case:

      Description

      Running apt-get update on the servers used by Ops Manager can have the sad consequence of changing the owner to the mongodb user from mongodb-mms user, potentially breaking backups for customers. The bit of code for the package that seems to apply here:

      Post-install:
      # create a mongodb group and user
      if ! getent passwd mongodb >/dev/null 2>&1; then
      adduser --system --no-create-home mongodb
      addgroup --system mongodb
      adduser mongodb mongodb
      fi
       
      # create db -- note: this should agree with dbpath in mongod.conf
      mkdir -p /var/lib/mongodb
      chown -R mongodb:mongodb /var/lib/mongodb
       
      # create logdir -- note: this should agree with logpath in mongod.conf
      mkdir -p /var/log/mongodb
      chown -R mongodb:mongodb /var/log/mongodb
      

      However, mongod is running as the mongodb-mms user (because Ops Manager's default user is mongodb-mms). Suggestion: chown if the directories don't previously exist, else no chown.

      (opened per request of Ernie Hershey)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: