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

pkill/pgrep cannot find mongod on Linux

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.5, 3.5.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • v3.4
    • Platforms 2017-01-23
    • 0

      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

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: