Server: exit gracefully
Server: added a debug "nodaemon" mode