mongoDB won't stop with shutdown or kill Not sure If I can make the same question already made here but here it goes. 

I have a mongodb fork and running with high CPU usage. I'm trying to shut it down but nothing seems to work. 

 2729 mwon      20   0 10.080g 9.047g  22668 S  56.2 28.8   4254:11 mongod --dbpath /disk2/db --port 27018 -logpath /disk2/db/mongod.log --fork


I have tried: 

mongod --dbpath /disk2/db --shutdown


but it hangs without any kind of response. I also tried:

 kill 2729
 kill -2 2729


The command gets executed but nothing happens. This is the tail of the log:

2019-07-30T15:55:27.757+0000 I NETWORK  [conn13356] end connection 127.0.0.1:45690 (62 connections now open)
2019-07-30T15:55:27.758+0000 I NETWORK  [conn13368] end connection 127.0.0.1:45764 (61 connections now open)
2019-07-30T15:55:27.759+0000 I NETWORK  [conn13380] end connection 127.0.0.1:45826 (60 connections now open)
2019-07-30T15:55:27.764+0000 I NETWORK  [conn13381] end connection 127.0.0.1:45832 (59 connections now open)
2019-07-30T15:55:27.764+0000 I NETWORK  [conn13369] end connection 127.0.0.1:45772 (58 connections now open)
2019-07-30T15:55:27.765+0000 I NETWORK  [conn13344] end connection 127.0.0.1:45628 (57 connections now open)
2019-07-30T15:59:17.043+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2019-07-30T15:59:17.044+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2019-07-30T15:59:17.044+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27018.sock
2019-07-30T16:23:37.773+0000 I NETWORK  [conn11035] end connection 127.0.0.1:48928 (56 connections now open)
Try the below commands:

kill &lt;process id&gt; 
kill -2 &lt;process id&gt; 
kill -SIGHUP &lt;process id&gt;
kill -SIGQUIT &lt;process id&gt; 
kill -SIGTERM &lt;process id&gt; 
kill -SIGKILL &lt;process id&gt;


or


Log on to your database
Switch to admin database
Execute the command db.shutdownServer() to gracefully shutdown mongodb which is the safest way to shut down the DB


Thank you!

-Anban