Proper shutdown of hive under whatever circumstances