SLES: Avoiding automatic restart of services when installing updates
To my experience, only very rarely a SLES or openSUSE update RPM will try to restart the service it is updating. But if it does, and you were preparing a production server for the maintenance window by installing updated files prior to the actual scheduled time (which you shouldn’t, but does work most of the time, so many of us do it), you may face severe consequences.
See for instance the openais package: It will try to restart the service and for those of you who don’t have to deal with that package regularily: It’s crucial for a HAE cluster node, stopping the service will stop all resources currently running on that node. Which is something you usually will not want to happen outside your maintenance window, for sure.
In anticipation of such a situation, SUSE has implemented a master switch (both available in SLES and openSUSE) in 2008. I wouldn’t know where it is documented, and the only interface to it is via YaST2’s “sysconfig editor”, but at least the openais package will respect the following settings from /etc/sysconfig/services:
## Path: System/Services ## Type: yesno ## Default: no # # Do you want to disable the automatic restart of services when # a new version gets installed? # DISABLE_RESTART_ON_UPDATE="no" ## Type: yesno ## Default: no # # Do you want to disable the automatic shutdown of services when # the corresponding package gets erased? # DISABLE_STOP_ON_REMOVAL="no"
My recommendation for any production server is to change DISABLE_RESTART_ON_UPDATE to “yes”, to avoid any unnecessary surprises. Many updates won’t even try to restart after update and those that will, hopefully are programmed to recognize and respect that /etc/sysconfig/services setting.
The only drawback to this recommendation: If you’re using i.e. cron to run automated updates to your system (which may impose its own set of problems all by itself), you’ll have to double-check the results and run manual service restarts, if required. But given that many services currently don’t restart anyhow, you’ll have to do that either way, so all you gain is more control, but lose nothing.