add mgs_daemon command and move configuration file
modify restart function