decouple running thread, add pid file to ignore