[daemon] add pid handling