Terminating remaining processes before shutdown