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

PIDFILEPATH computation in init scripts fails to handle comments after values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.8, 3.2.0-rc3
    • Component/s: Packaging
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Sprint:
      Build C (11/20/15)

      Description

      Found by Paschalis Korosoglou and reported via githib:

      I noticed (CentOS 6) that the init script fails to parse the contents of the configuration file as expected resulting in failure to stop the service when asked.

      The error steps in from this line in the init script:

      PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'"`
      

      What happens is that the PIDFILEPATH variable gets populated with all contents following the variable pidFilePath in the configuration file with spaces omitted. Hence using the default configuration file the bash variable gets the value:

      # echo $PIDFILEPATH
      /var/run/mongodb/mongod.pid#locationofpidfile
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: