Reputation: 10408
So, I accidentally started a duplicate script using forever.js, and now forever list
shows the same script on two processes.
Short of uninstalling forever, how can I simply kill a process/remove it completely, not just stop it?
Upvotes: 2
Views: 2808
Reputation: 1441
Best I have found is to do
ps -eaf
Then just
kill <thePidYouJustGot>
eg. kill 30566
Now it should be gone from forever list. :)
NOTE: if your script is not currently stopped doing this will not stop it! It will only remove it from 'forever list'! (But you can stop it yourself by also killing it with it's PID.)
(Optional)
For fun, this should also return the pid of the forever process for the desired entry:
ps -ef | awk '$NF=="myScript.js" {print $2}'
NOTE: replace 'myScript.js' with the location/file you used in the 'forever start' command. (You can find this with forever list
under the script column.) It might be something like 'myServer/myScript.js'.
Upvotes: 2