fix daemon (fork); lock basic function works