[csw-maintainers] Problem with "alternatives" on updates

Dagobert Michelsen dam at opencsw.org
Thu Feb 11 11:03:15 CET 2010


Hi Ben,

Am 10.02.2010 um 20:14 schrieb Ben Walton:
> I'll take that action. :)
>
> I meant to send this the other day, but forgot.  See attached dump
> from `rpm -q --scripts exim ` on RHEL5.  There is non-alternatives
> stuff in there too as I haven't cleaned it up at all.

Thanks for the snippet! However, I find the actions a bit strange:

> preuninstall scriptlet (using /bin/sh):
> if [ $1 = 0 ]; then
> 	/sbin/service exim stop > /dev/null 2>&1
> 	/sbin/chkconfig --del exim
> 	/usr/sbin/alternatives --remove mta /usr/sbin/sendmail.exim
> fi

This is ok.

> postuninstall scriptlet (using /bin/sh):
> if [ "$1" -ge "1" ]; then
> 	/sbin/service exim  condrestart > /dev/null 2>&1
> 	mta=`readlink /etc/alternatives/mta`
> 	if [ "$mta" == "/usr/sbin/sendmail.exim" ]; then
> 		/usr/sbin/alternatives --set mta /usr/sbin/sendmail.exim
> 	fi
> fi

This is strange, when the alternatives linkgroup has been set to manual
the readline would stay unaltered and the script would enter the clause.
However, as sendmail.exim already has been deleted in preuninstall
an error would have been thrown. Strange.


Best regards

   -- Dago



More information about the maintainers mailing list