reassign 454694 dpkg retitle 454694 dpkg loses track of /etc directories on --remove severity 454694 normal thanks
Kumar Appaiah <[EMAIL PROTECTED]> writes: > IMHO, you would definitely know better! :-) If you feel it is dpkg's > responsibility to handle this case, so be it, you can reassign it. I > trust that you would have attempted to reproduce what I tried in a > chroot, and confirmed it (I may have goofed up in my attempt). > > If you are sure, I'd rather have you reassign it to dpkg, since the > having the maintainer reassigning the bug carries more authority, in my > opinion. I spent some time working on this today in a chroot, and it definitely looks like a dpkg bug. It's fairly easily reproducible purely in sid; the upgrade from etch isn't needed. Both openafs-client and openafs-fileserver ship directories in /etc as part of the package: wanderer:/var/cache# dpkg -c etch/var/cache/apt/archives/openafs-client_1.4.6.dfsg1-1_i386.deb | grep /etc drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/ drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/openafs/ -rw-r--r-- root/root 5549 2007-12-17 20:22 ./etc/openafs/afs.conf drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/init.d/ -rwxr-xr-x root/root 7408 2007-12-17 20:22 ./etc/init.d/openafs-client wanderer:/var/cache# dpkg -c etch/var/cache/apt/archives/openafs-fileserver_1.4.6.dfsg1-1_i386.deb | grep /etc drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/ drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/openafs/ drwx------ root/root 0 2007-12-17 20:31 ./etc/openafs/server/ drwxr-xr-x root/root 0 2007-12-17 20:31 ./etc/init.d/ -rwxr-xr-x root/root 3329 2007-12-17 20:22 ./etc/init.d/openafs-fileserver After installing both of them, dpkg correctly recognizes that /etc/openafs is owned by both packages: wanderer:/var/cache# chroot /var/cache/etch dpkg -S /etc/openafs openafs-client, openafs-fileserver: /etc/openafs openafs-fileserver creates files in /etc/openafs/server from the postinst script (and removes them in postrm), but doesn't ship any configuration files in that directory. If one then removes openafs-fileserver (but doesn't purge it), dpkg recognizes that it can't remove /etc/openafs/server, but it then loses track that this means openafs-fileserver still also owns /etc/openafs: wanderer:/var/cache# chroot /var/cache/etch dpkg --remove openafs-fileserver (Reading database ... 8236 files and directories currently installed.) Removing openafs-fileserver ... bos: could not find entry (getting key from local KeyFile) bos: running unauthenticated bos: failed to shutdown servers (you are not authorized for this operation) bos: can't wait for processes to shutdown (you are not authorized for this operation) start-stop-daemon: nothing in /proc - not mounted? (Success) wanderer:/var/cache# chroot /var/cache/etch dpkg -S /etc/openafs openafs-client: /etc/openafs wanderer:/var/cache# chroot /var/cache/etch dpkg -L openafs-fileserver /var/log/openafs /var/lib/openafs /etc /etc/openafs/server /etc/init.d /etc/init.d/openafs-fileserver Note that it still realizes it needs to own /etc, but not /etc/openafs. The problem is that if one then removes and purges openafs-client, /etc/openafs ends up orphaned: wanderer:/var/cache# chroot /var/cache/etch dpkg --remove openafs-client (Reading database ... 8204 files and directories currently installed.) Removing openafs-client ... Stopping AFS services:start-stop-daemon: nothing in /proc - not mounted? (Success) Opening /proc/modules: No such file or directory . wanderer:/var/cache# chroot /var/cache/etch dpkg -S /etc/openafs openafs-client: /etc/openafs wanderer:/var/cache# chroot /var/cache/etch dpkg --purge openafs-client (Reading database ... 7976 files and directories currently installed.) Removing openafs-client ... Purging configuration files for openafs-client ... dpkg - warning: while removing openafs-client, directory `/etc/openafs' not empty so not removed. wanderer:/var/cache# chroot /var/cache/etch dpkg -S /etc/openafs dpkg: /etc/openafs not found. wanderer:/var/cache# chroot /var/cache/etch dpkg -L openafs-fileserver /var/log/openafs /var/lib/openafs /etc /etc/openafs/server /etc/init.d /etc/init.d/openafs-fileserver Purging openafs-fileserver then leaves the /etc/openafs directory behind because dpkg doesn't think any package owns it, although /etc/openafs/server is correctly removed. I don't know a lot about dpkg internals, but my guess is that the fix would be to teach dpkg that, when removing but not purging a package, the package needs to continue to own all parent directories of any directory still left. -- Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

