Debian Bug report logs -
#595112
dpkg-maintscript-helper: new helper for moving a conffile between packages
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, josh@joshtriplett.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Wed, 01 Sep 2010 06:57:05 GMT) (full text, mbox, link).
Message #3 received at submit@bugs.debian.org (full text, mbox, reply):
Package: dpkg
Version: 1.15.8.4
Severity: wishlist
File: /usr/bin/dpkg-maintscript-helper
Moving a conffile from one package to another seems to prove even more
difficult than renaming it or removing it. Please consider providing
support for this case in dpkg-maintscript-helper.
Thanks,
Josh Triplett
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.35-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dpkg depends on:
ii coreutils 8.5-1 GNU core utilities
ii libbz2-1.0 1.0.5-4 high-quality block-sorting file co
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libselinux1 2.0.96-1 SELinux runtime shared libraries
ii xz-utils 4.999.9beta+20100810-1 XZ-format compression utilities
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
dpkg recommends no packages.
Versions of packages dpkg suggests:
ii apt 0.8.0 Advanced front-end for dpkg
-- no debconf information
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Fri, 13 Jul 2012 15:27:50 GMT) (full text, mbox, link).
Acknowledgement sent
to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Fri, 13 Jul 2012 15:27:54 GMT) (full text, mbox, link).
Message #8 received at 595112@bugs.debian.org (full text, mbox, reply):
retitle 595112 dpkg-maintscript-helper: new helper for moving a conffile between packages
thanks
On Tue, 31 Aug 2010, Josh Triplett wrote:
> Moving a conffile from one package to another seems to prove even more
> difficult than renaming it or removing it. Please consider providing
> support for this case in dpkg-maintscript-helper.
What kind of problems are you referring to?
Michael Biebl reported in the thread at
http://lists.debian.org/4F31C323.9090606@debian.org
that the difficulty was to handle the case where the target
package has no guaranty to be installed. In that case, we
might keep the old conffile around when we don't really
want.
In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
I suggested to create a rm_conffile_if_owner helper
function to deal with this case.
Would this fit your needs too?
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
Changed Bug title to 'dpkg-maintscript-helper: new helper for moving a conffile between packages' from '/usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages'
Request was from Raphael Hertzog <hertzog@debian.org>
to control@bugs.debian.org.
(Fri, 13 Jul 2012 15:28:02 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Fri, 13 Jul 2012 19:36:36 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Fri, 13 Jul 2012 19:36:36 GMT) (full text, mbox, link).
Message #15 received at 595112@bugs.debian.org (full text, mbox, reply):
On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> retitle 595112 dpkg-maintscript-helper: new helper for moving a conffile between packages
> thanks
>
> On Tue, 31 Aug 2010, Josh Triplett wrote:
> > Moving a conffile from one package to another seems to prove even more
> > difficult than renaming it or removing it. Please consider providing
> > support for this case in dpkg-maintscript-helper.
>
> What kind of problems are you referring to?
>
> Michael Biebl reported in the thread at
> http://lists.debian.org/4F31C323.9090606@debian.org
> that the difficulty was to handle the case where the target
> package has no guaranty to be installed. In that case, we
> might keep the old conffile around when we don't really
> want.
>
> In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> I suggested to create a rm_conffile_if_owner helper
> function to deal with this case.
>
> Would this fit your needs too?
I *think* that would work. I don't need support for moving conffiles
between arbitrary packages, just support for allowing package2 to take
over a conffile from package1, and allowing package1 to drop the
conffile if not installing package2. How would rm_conffile_if_owner
behave with a modified conffile? Would it keep the conffile around in a
way that allows the new package to take it over with the old contents
still intact? And, would this also ensure that the conffile (even if
modified) gets removed when purging package1, if not yet taken over by
package2?
- Josh Triplett
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Tue, 31 Jul 2012 15:33:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Tue, 31 Jul 2012 15:33:03 GMT) (full text, mbox, link).
Message #20 received at 595112@bugs.debian.org (full text, mbox, reply):
Hi,
On Fri, 13 Jul 2012, Josh Triplett wrote:
> On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> > Michael Biebl reported in the thread at
> > http://lists.debian.org/4F31C323.9090606@debian.org
> > that the difficulty was to handle the case where the target
> > package has no guaranty to be installed. In that case, we
> > might keep the old conffile around when we don't really
> > want.
> >
> > In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> > I suggested to create a rm_conffile_if_owner helper
> > function to deal with this case.
> >
> > Would this fit your needs too?
>
> I *think* that would work. I don't need support for moving conffiles
> between arbitrary packages, just support for allowing package2 to take
> over a conffile from package1, and allowing package1 to drop the
> conffile if not installing package2. How would rm_conffile_if_owner
> behave with a modified conffile?
Just like rm_conffile. It would keep a ".dpkg-bak" copy of the file.
> Would it keep the conffile around in a way that allows the new package
> to take it over with the old contents still intact?
Hum, not sure. At least I was not intending it that way. I was rather
imagining that the dependencies would force the upgrade of the target
package at the same time. That is package1 would break the versions of
package2 that don't have the conffile.
That way, in package1's postinst we can be sure that:
- either package2 has taken the file over
- or package2 is not installed
> And, would this also ensure that the conffile (even if modified) gets
> removed when purging package1, if not yet taken over by package2?
Yes, that should be part of the contract of rm_conffile_if_owner. But
it will only have to deal with this in the case of a modified conffile
(since the non-modified conffile would be pruned before-hand in the
postinst).
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Tue, 31 Jul 2012 16:00:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Tue, 31 Jul 2012 16:00:02 GMT) (full text, mbox, link).
Message #25 received at 595112@bugs.debian.org (full text, mbox, reply):
On Tue, Jul 31, 2012 at 05:21:38PM +0200, Raphael Hertzog wrote:
> On Fri, 13 Jul 2012, Josh Triplett wrote:
> > On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> > > Michael Biebl reported in the thread at
> > > http://lists.debian.org/4F31C323.9090606@debian.org
> > > that the difficulty was to handle the case where the target
> > > package has no guaranty to be installed. In that case, we
> > > might keep the old conffile around when we don't really
> > > want.
> > >
> > > In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> > > I suggested to create a rm_conffile_if_owner helper
> > > function to deal with this case.
> > >
> > > Would this fit your needs too?
> >
> > I *think* that would work. I don't need support for moving conffiles
> > between arbitrary packages, just support for allowing package2 to take
> > over a conffile from package1, and allowing package1 to drop the
> > conffile if not installing package2. How would rm_conffile_if_owner
> > behave with a modified conffile?
>
> Just like rm_conffile. It would keep a ".dpkg-bak" copy of the file.
>
> > Would it keep the conffile around in a way that allows the new package
> > to take it over with the old contents still intact?
>
> Hum, not sure. At least I was not intending it that way. I was rather
> imagining that the dependencies would force the upgrade of the target
> package at the same time. That is package1 would break the versions of
> package2 that don't have the conffile.
>
> That way, in package1's postinst we can be sure that:
> - either package2 has taken the file over
> - or package2 is not installed
Consider the original motivation for this. You have a package A, which
contains a daemon B and an init script /etc/init.d/B. You split B and
its init script (and any other configuration files for it) into its own
package, which A does not depend on. If installing B, you want to
preserve the configuration of B. B didn't exist beforehand, so no
package exists for A to declare a Breaks against. However, nothing
guarantees that the user will install B at the same time as upgrading A.
In particular, it seems highly likely that a user who wants B will
upgrade A, read the NEWS.Debian file, and then choose whether to install
B.
- Josh Triplett
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Tue, 31 Jul 2012 18:51:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Tue, 31 Jul 2012 18:51:06 GMT) (full text, mbox, link).
Message #30 received at 595112@bugs.debian.org (full text, mbox, reply):
On Tue, 31 Jul 2012, Josh Triplett wrote:
> Consider the original motivation for this. You have a package A, which
> contains a daemon B and an init script /etc/init.d/B. You split B and
> its init script (and any other configuration files for it) into its own
> package, which A does not depend on. If installing B, you want to
> preserve the configuration of B. B didn't exist beforehand, so no
> package exists for A to declare a Breaks against. However, nothing
> guarantees that the user will install B at the same time as upgrading A.
> In particular, it seems highly likely that a user who wants B will
> upgrade A, read the NEWS.Debian file, and then choose whether to install
> B.
OK so we really need a "recover_conffile" which would be used in
package2 and would move a .dpkg-bak copy in its original place.
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Thu, 02 Aug 2012 07:51:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Thu, 02 Aug 2012 07:51:06 GMT) (full text, mbox, link).
Message #35 received at 595112@bugs.debian.org (full text, mbox, reply):
On Tue, Jul 31, 2012 at 08:47:06PM +0200, Raphael Hertzog wrote:
> On Tue, 31 Jul 2012, Josh Triplett wrote:
> > Consider the original motivation for this. You have a package A, which
> > contains a daemon B and an init script /etc/init.d/B. You split B and
> > its init script (and any other configuration files for it) into its own
> > package, which A does not depend on. If installing B, you want to
> > preserve the configuration of B. B didn't exist beforehand, so no
> > package exists for A to declare a Breaks against. However, nothing
> > guarantees that the user will install B at the same time as upgrading A.
> > In particular, it seems highly likely that a user who wants B will
> > upgrade A, read the NEWS.Debian file, and then choose whether to install
> > B.
>
> OK so we really need a "recover_conffile" which would be used in
> package2 and would move a .dpkg-bak copy in its original place.
That sounds perfect. Package A would use rm_conffile, which would move
a modified conffile to .dpkg-bak; package B would ship a default
configuration file, and use recover_conffile, which would move the
.dpkg-bak file over the top of the default configuration file if it
exists.
- Josh Triplett
Merged 595112 672945
Request was from Raphaël Hertzog <hertzog@debian.org>
to control@bugs.debian.org.
(Wed, 05 Sep 2012 14:12:08 GMT) (full text, mbox, link).
Added indication that bug 595112 blocks 689780
Request was from Mark Purcell <msp@debian.org>
to control@bugs.debian.org.
(Sat, 20 Oct 2012 01:09:04 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Sun, 11 Oct 2015 16:48:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Felipe Sateler <fsateler@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Sun, 11 Oct 2015 16:48:03 GMT) (full text, mbox, link).
Message #44 received at 595112@bugs.debian.org (full text, mbox, reply):
On Tue, 31 Jul 2012 20:47:06 +0200 Raphael Hertzog <hertzog@debian.org> wrote:
> On Tue, 31 Jul 2012, Josh Triplett wrote:
> > Consider the original motivation for this. You have a package A, which
> > contains a daemon B and an init script /etc/init.d/B. You split B and
> > its init script (and any other configuration files for it) into its own
> > package, which A does not depend on. If installing B, you want to
> > preserve the configuration of B. B didn't exist beforehand, so no
> > package exists for A to declare a Breaks against. However, nothing
> > guarantees that the user will install B at the same time as upgrading A.
> > In particular, it seems highly likely that a user who wants B will
> > upgrade A, read the NEWS.Debian file, and then choose whether to install
> > B.
>
> OK so we really need a "recover_conffile" which would be used in
> package2 and would move a .dpkg-bak copy in its original place.
In systemd, we split a new package systemd-container. We used the
approach to rm_conffile in systemd for the appropriate version, and
added the following snippet to systemd-container:
machine_policy=/etc/dbus-1/system.d/org.freedesktop.machine1.conf
if [ "$1" = configure ] && [ -z "$2" ] && [ -f
${machine_policy}.dpkg-bak ] ; then
md5sum="$(md5sum ${machine_policy} | sed -e 's/ .*//')"
old_md5sum="$(dpkg-query -W -f='${Conffiles}' systemd-container | \
sed -n -e "\' ${machine_policy} ' { s/
obsolete$//; s/.* //; p }")"
# On new installs, if the policy file was preserved on systemd upgrade
# by dpkg-maintscript helper, copy it back if the new file has not
been modified yet
if [ "$md5sum" = "$old_md5sum" ] ; then
mv ${machine_policy}.dpkg-bak ${machine_policy}
fi
fi
Because this is a new package, we test -z "$2". If this was a move
between pre-existing packages, then the test should be with dpkg
--compare-versions
So far we have not received bugs about this usage.
A caveat to be aware of, is that the advice given by the man page to
use the version where the rm_conffile command is added is not
appropriate for this use case: because now the file is owned by a
different package, one should not try to remove the file in a version
later than the one that actually stops shipping the file. This implies
that if one moves a conffile between packages but forgets to add the
maintscript helpers, and adds the helpers in a later version, then the
orphaned conffile will remain if the new package is not installed.
This is unfortunate but we did not find a way to reliably determine
when the file can actually be removed.
Please implement this helper in dpkg-maintscript-helper; it seems we
will need this a lot if we decide split up the systemd package
further.
Saludos
Information forwarded
to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg.
(Sat, 09 Apr 2016 17:03:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Felipe Sateler <fsateler@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>.
(Sat, 09 Apr 2016 17:03:05 GMT) (full text, mbox, link).
Message #49 received at 595112@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
On 11 October 2015 at 13:45, Felipe Sateler <fsateler@gmail.com> wrote:
> Please implement this helper in dpkg-maintscript-helper;
Please find attached a patch to kickstart the discussion.
Documentation is missing. accept_conffile will move a .dpkg-bak file
left from rm_conffile if upgrading from a version older than the
passed version (or only on first install if empy is passed as
version).
--
Saludos,
Felipe Sateler
[accept.diff (text/plain, attachment)]
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Jul 2 06:43:43 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.