How can my daemon detect that machine is restarted