clone 588700 -1
retitle -1 postinst fails with deleted configuration files
thanks

This is a completely different bug from the two previous ones, that were
about the ACL plugin failure and the postrm dependency on lighttpd. This
is the third bug you report in that single thread: please file a single
bug report for *each* bug you hit instead.

Le jeudi 15 juillet 2010, Balaji Dutt a écrit :
> Package: dokuwiki
> In order to test the fixes for the acl plugin in 0.0.20091225c-5, I did the 
> following:
> 
> 1. Uninstalled dokuwiki using "aptitude remove"
> 2. Manually removed the paths /etc/dokuwiki, /usr/share/dokuwiki and 
> /var/lib/dokuwiki
> [3. Installed dokuwiki]

Bad idea: see below.

> Not replacing deleted config file /etc/dokuwiki/htaccess
> Not replacing deleted config file /var/lib/dokuwiki/acl/users.auth.php

As you can see, the package manager, or, to be more specific, the
configuration file manager sees that you deleted the configuration files
(a deletion is a kind of change), and does not replace them, simply
honnoring your choice of deleting the configuration files.

> chown: cannot access `/var/lib/dokuwiki/acl/users.auth.php': No such file or 
> directory
> dpkg: error processing dokuwiki (--configure):
>  subprocess post-installation script returned error exit status 1
> Errors were encountered while processing:
>  dokuwiki
> E: Sub-process /usr/bin/dpkg returned an error code (1)

This, however, is actually a bug. I will change the scripts to ignore
non-existant config files.

> In addition, once dokuwiki is fully configured, the files in /etc/dokuwiki do 
> not appear to be properly replaced:
> As you can see all the files have a "dpkg-new" extension appended. This 
> causes an error when trying to access 
> dokuwiki.

Yes, this is the expected behaviour of any package. Delete the
configuration files, and it will not replace them for you. It will only
install .dpkg-new or .ucf-new, not to interfere with your own
modifications. Then you are free to copy them to their regular names.

So, to sum up:
- when you delete configuration files, it is normal that a
  reinstallation does not restore them at their original names: it
  simply respects your choice of deleting them, but restores the
  original ones with names that do not interfere;
- when you delete configuration files, it is normal that your software
  does not work anymore;
- however, it is not normal that the postinst script fails if a
  configuration file has been deleted, and this is what I will fix.

As an advice, if you want to reinstall a package to get its original
configuration files, you have two options:
- reinstall it (or upgrade it), then copy the new configuration files
  (they have the .*-new extension) erasing your ones;
- backup your configuration files, then purge the package, then install
  it.

-- 
Tanguy Ortolo

Attachment: signature.asc
Description: Digital signature

Reply via email to