#!/bin/bash # When a package is upgraded, there may be some shared # libs that are leftover by the previous package. # It is not feasible to remove these libs while the system # is up and running since some running program may have loaded the # lib in memory and it may cause problems for the application. # The safest way to delete the file is when the system is being # booted up. # This script creates a file of all libs that need to be cleaned. # On bootup, the bootscript checks the file and cleans the files # indicated in the list. source `which ttPM-funcs` 2>/dev/null || exit 1 # Need to be root checkRoot # Create the cleanLibs file and change permissions touch $TT_FLAGS_DIR/cleanLibs chown $TT_PKG_USER:$TT_PKG_USER $TT_FLAGS_DIR/cleanLibs chmod 664 $TT_FLAGS_DIR/cleanLibs until [ -z "$1" ] do if [ -f $1 ] then echo "$1" >> $TT_FLAGS_DIR/cleanLibs && chown root:root $1 fi printMsg info "${1} will be removed on next boot" install -d /var/lib/runonce && ln -sf `which cleanLibs` /var/lib/runonce shift done