Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 26 Nov 2003 21:38:57 +0300
From: Solar Designer <solar@...nwall.com>
To: owl-users@...ts.openwall.com
Subject: Re: Bug in Postfix remove script

On Wed, Nov 26, 2003 at 07:27:21PM +0100, Andreas Ericsson wrote:
> > On Wed, Nov 26, 2003 at 05:44:15PM +0100, Andreas Ericsson wrote:
> > > > -	rmdir /var/spool/postfix/[^m]*
> > > > +	rmdir /var/spool/postfix/[^m]* || true
> >
> > > This will cause rpm to happily move on no matter what the error, which
> > > isn't the intended behaviour.
> >
> > Actually it is.
> 
> Then what's the point of having rpm break on errors?

It depends.  In %prep, %build, and %install scripts, we don't want a
broken package to get built.  In %pre, we don't want to install a
package if we can't do the preparations.  However, when it comes to
%post, %preun, and especially %postun, we most often want to continue
on errors (this does not imply we ignore them: we may choose to act
differently or at least to let an error message get displayed).

> > The purpose of this rmdir is to remove directories which are empty,
> > but leave around those which aren't such that you don't lose your
> > queued e-mail messages just because you happened to (temporarily?)
> > uninstall Postfix.
> 
> And with the fix,

I'm not sure which fix you're referring to here.

> everything but the 'maildrop' directory

This one is a part of the package and will be removed by RPM itself,
this is why we don't to remove it manually.

(Actually, the entire Postfix package will change as we update to
2.0.x and things will be done differently.)

> and any directory the user hasn't got access to

I'm not sure what you mean here.

> will be removed.
> Isn't that the general idea? (I'm trying to learn something here)

I think I've explained it already: all directories which don't hold
queued messages are to be removed on uninstall.  Those which do are
left around in case of re-install or for manual removal, -- the admin
has to make that decision explicitly and the "rmdir" will report any
such non-empty directory such that the admin will get notified.

> > If you install Postfix but don't use it and just uninstall, then
> > everything gets removed cleanly.
> 
> With exception of the rare times when installation halts before or
> during %post due to some error or the user pressing Ctrl-C because
> they don't want postfix.

Correct, -- and in that case a harmless error message on uninstall is
quite normal.  In fact, RPM itself can complain too.

-- 
Alexander Peslyak <solar@...nwall.com>
GPG key ID: B35D3598  fp: 6429 0D7E F130 C13E C929  6447 73C3 A290 B35D 3598
http://www.openwall.com - bringing security into open computing environments

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.