I have a program that using phantomjs
.
There should be only a instance for the program and there is no program using Phantomjs
.
But sometimes Phantomjs
are launched several instances sametime. Probably my program have a bug. For quick fix I want to kill old instance if there are Phantomjs
instance more than one by monit.
I can find the instances of Phantomjs by using matching
function in monit
. But I couldn't find out how to compare two instance status and kill old one.
I'd be very grateful for any advice.