R4R: various upgrade shutdown logic