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

daemon script pid parse issue

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Packaging
    • Labels:
      None
    • ALL

      /etc/init.d/mongod

      Here is the line from parse PIDFILEPATH

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

      The default configure file come from rpm /etc/mongod.conf for pid is

        pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
      

      When daemon parse PIDFILEPATH from configure file, it get the comment line too.

      Now the issue is
      pid file be created by mongo using the configure/option file, which support "#".
      Daemon use PIDFILEPATH parse trying to get some pid file to find pid and kill. It got incorrect file name and cannot kill mongod for clean shutdown.

      What user saw is using standard systemctl stop mongod.service or service stop mongod, prompt will return OK but cannot stop mongod.,

            Assignee:
            Unassigned Unassigned
            Reporter:
            lxu Linda Xu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: