create alarmd and alarmd main routine
minor modify