The poll is dead block in libpq when application run with daemon

I have an application which use the pqxx and libpq to connect to postgresql to query the data, every thing work fine with non-daemon mode, but once daemonized the application, the poll function is dead blocked in the libpq, how could I solve this issue ?