fix a issue that read_pid() has failed when a trema name was switch-daemon
add debug message