Swap the order of cache_up and daemonize
Use pid file to prevent multiple processes run