From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020913 Description of problem: I don't like this funtion into %preun. It is very dangerous to use _rm_ for delete queues dirs and It is possible lost mail!!! I would like see that rpm delete them (if it can -> empty dirs) automatically and not by hand. -thanks- # selectively remove the rest of the queue directory structure # first remove the "queues" (and assume the hash depth is still 2) queue_directory_remove () { for dir in active bounce defer deferred flush incoming; do for a in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do test -d $dir/$a && { for b in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do test -d $dir/$a/$b && ( /bin/rm -f $dir/$a/$b/* /bin/rmdir $dir/$a/$b ) done /bin/rmdir $dir/$a || echo "WARNING: preun - unable to remove directory %{_var}/spool/postfix/$dir/$a" } done /bin/rmdir $dir || echo "WARNING: preun - unable to remove directory %{_var}/spool/postfix/$dir" done # now remove the other directories for dir in corrupt maildrop pid private public saved; do test -d $dir && { /bin/rm -f $dir/* /bin/rmdir $dir || echo "WARNING: preun - unable to remove directory %{_var}/spool/postfix/$dir" } done } Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.- 2.- 3.- Additional info:
I'm not 100% sure I understand what you are asking for. Is your suggestion not to remove a queue directory if its not empty or are you saying not to remove any of the queue directories? Why would that be the proper uninstall behavior? If one is uninstalling postfix as opposed to upgrading then why is the loss of mail left in queue that will never be accessed again an issue?
>I'm not 100% sure I understand what you are asking for. Is your suggestion not to remove a queue directory if its not empty or are you saying not to remove any of the queue directories? Why would that be the proper uninstall behavior? It means "doesn't delete any file or dir placing *rm* code into a spec file" rpm knowns how to handle it automatically, this is a job for %files section >If one is uninstalling postfix as opposed to upgrading then why is the loss of mail left in queue that will never be accessed again an issue? because to delete a file/dir, which was *not into the rpm package*, is very bad rule. And worse if it delete mail!!! -thanks-
I will make the change if you can provide a reasonable argument as to why the queue directories and their contents are of value after removing postfix from the machine, any mail that is stuck there will never be processed anyway. Fair enough?
>I will make the change if you can provide a reasonable argument as to why the ok I will do: - to delete files not in possession of a package is a dangerous/bad habit. - no other rpm package use rm to delete files or dirs, 'rpm' knows how to do it _automatically_. rpm is *the* package management!! People hope that, more or less, all rpm packages will have the same behaviour. Sendmail doesn't delete _any_ queue files. rpm saves in a .rpmsave files that have been modified and it's strange that postix delete files not in his own >queue directories and their contents are of value after removing postfix from the machine, any mail that is stuck there will never be processed anyway. rpm automatically deletes empty dirs, if rpm is unable to delete them then directories contain files out of this package. maybe other package or the admin had created them. I hope that maintainer of filesystem spec doesn't use rm }:-)
I have removed all the code in the spec file which deletes files and directories duing an uninstall.
thank you