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

YAML pidFilePath not handled correctly on RHEL / CentOS 6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0-rc8, 3.0.0-rc9, 3.0.0-rc10, 3.0.0-rc11
    • Fix Version/s: None
    • Component/s: Admin, Packaging
    • Labels:
    • Environment:
      CentOS / RHEL 6 (and maybe 7)
    • Operating System:
      Linux
    • Steps To Reproduce:
      Hide

      in mongod.conf, under RHEL 6 (maybe also 7), set (as described in the docs):
      pidFilePath: "/dir/to/pid.file"

      To "fix" it, one needs to define the value without the ticks, like:
      pidFilePath: /dir/to/pid.file

      Thus defining a string without the ticks, resulting in an invalid YAML file

      Show
      in mongod.conf, under RHEL 6 (maybe also 7), set (as described in the docs): pidFilePath: "/dir/to/pid.file" To "fix" it, one needs to define the value without the ticks, like: pidFilePath: /dir/to/pid.file Thus defining a string without the ticks, resulting in an invalid YAML file

      Description

      In RHEL 6, when setting up a YAML configuration file, if you enter the expected string value for pidFilePath, as described in the docs(http://docs.mongodb.org/manual/reference/configuration-options/#processManagement.pidFilePath), mongo won't start.

      the awk parsing or the subsequent 'dirname' call will cause the $PIDDIR variable to have a trailing tick

      The following:
      PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]](processManagement\.)?pidfilepath[[:blank:]][:=][[:blank:]]*/

      {print $2}

      ' "$CONFIGFILE" | tr -d '[:blank:]'`
      results in
      $PIDFILEPATH being "/dir/to/pid.file"

      PIDDIR=`dirname $PIDFILEPATH`
      results in
      $PIDDIR being "dir/to

      which obviously causes the /etc/init.d/mongod to crash and avoids mongo to start

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              MRigal Matthieu Rigal
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: