[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to get dpkg to remove directories?



On 11-Jun-02, 13:50 (CDT), Grant Edwards <grante@visi.com> wrote: 
> Thanks.  There are actually two problems with my package I'm
> trying to address:
> 
>  1) I am not willing to ship a package that generates warning
>     messages when it's removed.  Warning messages generate
>     calls to tech support, and that costs money.
> 
>  2) After my package has been purged, I don't want any files or
>     empty directories left over.  Perhaps it's just me, but
>     this would seem to be the obvious expectation of the
>     customer.

Let's distinguish between "removed" and "purged" (you may be doing so
already, in which case it's me that's confused).

Removed: all non-configuration files deleted. 

Purged: all traces of package removed.

The warnings you're referring to in 1 are because the directory is
unique to the package, and the dpkg --remove process wants to delete
it, but it can't because still has files in it (Yes, I know, already
explained, but I'm trying to pull stuff together here.) In this
case, those files are configuration files (either conffiles in the
package, or non-packages files generated/managed (presumably) by the
{pre,post}{inst,rm} scripts. When you "dpkg --purge", the files are
deleted (either by dpkg or by the scripts) before dpkg tries (again) to
delete the directories, and no warnings are generated.

> AFAICT, I can avoid both problems by not creating a directory under /etc
> for my config files.

Yep, true. But those warnings are completely normal, if annoying. Any
Debian admin is going to be used to them. Playing games with your
particular package isn't going to get rid of them.

> I'm still not convinced that files in /etc/init.d and
> /etc/cron.daily should conffiles.  They're not supposed to be
> edited: that's why I created conffiles under /etc.

Debian has decided that those files are configuration files. You've
provided configuration externally, but others do not, and that's the way
it is. On the other hand, if

Now, there is nothing to prevent you from supplying a cron.daily script that consists solely of 

	#! /bin/sh
    test -x /usr/lib/mystuff/realscript && exec /usr/lib/mystuff/realscript

to make it clear that you really don't want it edited. In fact, that
is what you *should* do, if, as you claim, the script being run is not
supposed to be edited. 

As far as the init.d scripts go, they can test for the same thing (to
determine that the package has been removed), and so far as editing
it goes, put in a comment at the beginning that says "# Configure in
/etc/foo.conf" and don't worry about it.

-- 
Steve Greenland

    The irony is that Bill Gates claims to be making a stable operating
    system and Linus Torvalds claims to be trying to take over the
    world.       -- seen on the net


-- 
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: