On 02/18/2013 06:14 PM, Cristian Rodríguez wrote:
El 18/02/13 14:04, Claudio Freire escribió: zypper ps only list files deleted or changes *after* the fact.. it is much better to do things when none of the "to-be-updated" components are running.
I would like to add something to the discussion here: I am currently using a bash script that does the following: 1) Walk thru all available patches shown by "zypper lp" and figure out the affected RPMs (zypper -q -n if -t patch $PATCH) 2) Get a list of all files included in the currently installed version of an RPM to be upgraded (rpm -ql $PACKAGE) 3) Grep the output "lsof" with the list of files from above. 4) If none of the files of all RPMs affected by a particular patch are currently in use, flag this patch as "safe to install" 5) Install all patches with "zypper -n in -t patch" that were flagged "safe to install". 6) Notify the logged in users (via email in our case) if there are any patches left which cannot be installed, as the affected files are in use. As our users are quite technically skilled, tell them the list of affected files and let them decide to logout/reboot and install manually. Using this script I managed to update all system components that are currently not in use and I notify the user only if he really needs to take action. I am not blindly installing all available patches, possibly creating problems for running applications. This has worked quite nicely until now. Problems have occured with kernel upgrades (as the kernel and its modules may not be shown in lsof), hence I now exclude all patches that have the "Reboot Required: Yes" set from the "zypper lp" list. -J Brauchle