Terminate application gracefully upon receiving SIGTERM signal.