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

Re: one package altering other package's postrm



Hi!

On Sat, 2014-12-13 at 23:09:08 +0100, Alexandre Detiste wrote:
> Would it be OK / ugly / forbiden to do a
> "rm -f /var/lib/dpkg/info/cron.postrm"
> in systemd-cron preinst script ?

This would be just wrong and unnecessary. This is not the prerm case in
<https://wiki.debian.org/Teams/Dpkg/FAQ#Q:_Can_dpkg_be_told_to_avoid_invoking_a_harmful_prerm_from_an_installed_package_on_upgrade.3F>,
which cannot be avoided.

> This is needed to avoid that /etc/cron.allow & /etc/cron.deny disapears
> when cron is purged but systemd-cron still needs those. (from v1.5.1)
> 
> In http://anonscm.debian.org/cgit/pkg-cron/pkg-cron.git/tree/debian/postrm :
> # if [ "$1" = "purge" ]; then 
> #    rm -f /etc/cron.allow /etc/cron.deny
> # fi
> 
> The handover of custom /etc/crontab works fine thank to the "Replace:"
> in d/control

There are some possible more “correct” ways to fix this, for example:

  * Move the handling of those (and any other) common files or dirs
    (like /etc/cron.allow, /etc/cron.deny, crontab.5, /etc/crontab,
    the /etc/cron.* dirs and placeholders, and possibly also the cron
    spool) to a third package (say cron-common/cron-support/cron-base/etc)
    that both packages depend on.
  * Or change cron (and systemd-cron) to take into account each others
    presence to not purge those files in that case (although this one
    is not future-proof).

Appropriate Breaks would need to be added to both packages on the fixed
versions.

Thanks,
Guillem


Reply to: