Support pids_dir and auto_restart
Fix auto restart