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

YAML pidFilePath not handled correctly on RHEL / CentOS 6

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0-rc8, 3.0.0-rc9, 3.0.0-rc10, 3.0.0-rc11
    • Component/s: Admin, Packaging
    • Labels:
    • Environment:
      CentOS / RHEL 6 (and maybe 7)
    • Linux
    • 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

      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

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

              Created:
              Updated:
              Resolved: