added exception handling of SIGTERM signal to write default /etc/hosts file