i want to print message at client side at time of uninstall like if error then i always print and if it is simple message like rpm uninstall successfully then it is optional .client use the option -v then it print (verbose other wise not)
rpm -ivh xyz.rpm for install and rpm -ev xyz for uninstall as below.
#Pre-Uninstall section
%preun
Processes=`ps -Ao"%p:%a" --cols 150 |
egrep "Launcher|rmiregistry" | grep -v grep | cut -d ":" -f1`
if [ -n "$Processes" ]; then
echo 'xyz is running ,first stop it then uninstall.' > /dev/stderr;
exit 1;
else
echo 'xyz service is not running' >/dev/stdout;
fi
currently the above code print each and every time of rpm uninstall.