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

pkill/pgrep cannot find mongod on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.5, 3.5.1
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Sprint:
      Platforms 2017-01-23
    • Linked BF Score:
      0

      Description

      pkill/pgrep uses the "Name" field in /proc/*/status as the name of process. On Linux, this field is the process name by default. But this field is not the process name, it is the thread name of the main thread. Thread names in Linux simply default to the process name.

      If a program calls pthread_setname_np, the name is updated to be the thread name. This breaks simple commands like "pkill mongod" as an example. The proper command to use instead is "pkill initAndListen" since that is the name of the main thread. This is undesired behavior. MongoDB needs to stop setting thread names on the main() thread as a result of this behavior.

      Reported by David Hows

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: