Added RTD_PORTS and graceful killing.