Daemon adapted so restart works