Better error handling on SIGTERM; refactoring logging for PIDs;  conditonaly setup ENV for http_proxy