Please see UPS_shutdown section.