daemon basic c++ form