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

Red Hat init.d script error: YAML config file parsing

    XMLWordPrintable

    Details

    • Operating System:
      Linux
    • Backport Completed:
    • Sprint:
      Build Team 2.7.0, BUILD 2.7.1, BUILD 2.8.0-rc2

      Description

      In 2.6, MongoDB now supports YAML configuration files.

      The /etc/rc.d/init.d/mongod script in the mongodb-org RPM package doesn't work because of the following line that parses the pidfile path from the config file:

      PIDFILE=`awk -F= '/^pidfilepath[[:blank:]]*=[[:blank:]]*/{print $2}' "$CONFIGFILE"`

      The above line doesn't correctly parse YAML configuration files, so the init.d script is unable to retrieve the pidfile needed to stop the mongod service.

      The regex should be modified to cover both old and new style configuration files. The following works for YAML files:

      PIDFILE=`awk -F: '/^[[:blank:]]*pidFilePath[[:blank:]]*:[[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d ' '`

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: