pre-deactivate - error if process running

Ryan Schmidt ryandesign at macports.org
Thu May 24 22:00:46 PDT 2012


On May 24, 2012, at 16:02, Craig Treleaven wrote:

> I'd like to add a check to my in-progress portfile, testing whether the main server process ("mythbackend") is running and refusing to deactivate if so.  The reason is that launchd will keep trying to restart the missing program every 10 seconds--apparently without end! Floods the console log with messages even though there is little other harm.
> 
> I've searched around a bit and can't find any ports that seem to do that sort of test.  Could someone point me to some sample code?  I suppose something like 'ps -Ac | grep interestingprogram'?

This is really something we should implement in MacPorts base. MacPorts should prevent you from deactivating a port you loaded; you should be required to unload the port first.




More information about the macports-dev mailing list