def shutdown(): if proc: os.killpg(proc.pid, 2) for d in [users, tmp, logs, topic]: if os.path.isdir(d): shutil.rmtree(d)