add daemon and SIGTERM callback to lgserver.
Signed-off-by: Daogang Tang <daogangtang@126.com>