SPECS: openldap.spec - %preun & %postun should never fail (said

Tomasz Wittner twittner at o2.pl
Thu Dec 2 00:15:10 CET 2004


On Sun 28. of November 2004 16:38, Andrzej Krzysztofowicz wrote:
> Jakub Bogusz wrote:
> > On Sun, Nov 28, 2004 at 05:51:31AM +0100, Andrzej Krzysztofowicz wrote:
> > > twittner wrote:
> > > > Author: twittner                     Date: Sat Nov 27 17:32:36 2004
> > > > GMT Module: SPECS                         Tag: HEAD
> > > > ---- Log message:
> > > > - %preun & %postun should never fail (said saq ?) - added || :
> > >
First of all - sorry for long delay (I check my e-mail account accidentaly -  
I don't have persist internet connection - please, be patient with me).
I've added indiscriminately ` || :' to almost every command in %(post/pre)un 
after seening following errors during "mass uninstalation":

$ a=($(rpm -qa openldap\*));sudo rpm -ev --allmatches --nodeps $a
?
Stopping OpenLDAP service..........................................[ DONE ]
Stopping OpenLDAP Update Replication Daemon service................[ DONE ]
Starting OpenLDAP service..........................................[ FAIL ]
slapd: error while loading shared libraries: libldap_r-2.2.so.7: cannot open 
shared object file: No such fileor directory
Starting OpenLDAP Update Replication Daemon service................[ FAIL ]
slurpd: error while loading shared libraries: libldap_r-2.2.so.7: cannot open 
shared object file: No such file or directory
error: %preun(openldap-backend-ldbm-2.2.18-2) scriptlet failed, exit status 1
?
?
warning: /etc/openldap/slapd.conf saved as /etc/openldap/slapd.conf.rpmsave
Removing user slapd
/usr/sbin/userdel: error while loading shared libraries: libldap-2.2.so.7: 
cannot open shared object file: Nosuch file or directory
Removing group slapd
/usr/sbin/groupdel: error while loading shared libraries: libldap-2.2.so.7: 
cannot open shared object file: No such file or directory

After this uninstalation:

$ rpm -qa openldap\*
openldap-backend-ldbm-2.2.18-2

Yes, I know some errors are caused by --nodeps (user/groupdel from pwdutils 
depends on openldap-libs).

> > > %post and %preun should never fail.
> >
> > I haven't tested it, but doesn't %preun fault prevent
> > upgrade/uninstallation? If so, it could be useful sometimes.
>
> I assume that need of uninstalable packages is rather rare.
> Maybe postgresql update would be the only case I know.
Personally, I hate situation when I cannot uninstall packages without 
--noscripts (I've spotted such situation in courier-imap long time ago).
>
> > > In postun it is no problem.
> > > So why do you want to hide errors here ?
> > >
> > > > +%postun libs
> > > > +/sbin/ldconfig || :
> > >
> > > And this way you cause dependency is not autogwnerated ?
> >
> > It is, but it's /bin/sh not /sbin/ldconfig dependency then ;)
>
> exactly

Add them maunally if necessary ;).
Anyway, thank you Ankry for your fixes and apologize for making chaos.

-- 
Tomasz Wittner




More information about the pld-devel-en mailing list