add error handling for daemon script on ubuntu