[Bug 1594457] [NEW] dpkg-reconfigure does not process manually activated triggers
Sasa Vilic
1594457 at bugs.launchpad.net
Mon Jun 20 17:06:04 UTC 2016
Public bug reported:
I have package A that activated trigger and package B which should be
reconfigured when trigger is activated (listens for trigger). Trigger is
activated by postinst script in package A by using `dpkg-trigger my-
trigger`.
After looking into source code (/usr/sbin/dpkg-reconfigure), I can see
that problem is in method triggers_pending from line 201-206. What
happens is that variable $triggers will contain additional space at the
end of line (not present in 16.04) and so it will satisfy condition on
line 205.
So what happens is following?
1. When dpkg-reconfigure is executed, triggers_pending is called to get information about packages with pending triggers
2. Because of bug, every package will be put into list (packages without pending triggers)
3. At the end, dpkg-reconfigure will call again triggers_pending() and will check of new packages that have pending triggers. But because all packages are on original list, no change is detected and none of pending packages is (re-)configured. This leave original package in trigger-pending state.
How to reproduce?
1. Create package A, and it's postinst script call 'dpkg-trigger A-my-trigger'
2. Create package B, that listens for 'A-my-trigger'
3. Install both packages
4. Do: dpkg-reconfigure A
5. Package A will be left broken and no reconfigure step will be executed for package B
How to fix?
Well, I replaced /usr/sbin/dpkg-reconfigure: if (length $triggers) {
with: if ($triggers !~ /^\s*$/) {
and this solved the problem, except that it introduced additional
problem:
My package A does not use debconf for querying parameters and package B
does. But because dpkg-reconfigure messes with DEBIAN_HAS_FRONTEND
environment variable, the frontend is not started, but instead db_get
questions are posted on console (to user) and reconfiguration is halted.
Currently, I don't know enough debconf system in order to provide
solution for this.
** Affects: debconf (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debconf in Ubuntu.
https://bugs.launchpad.net/bugs/1594457
Title:
dpkg-reconfigure does not process manually activated triggers
Status in debconf package in Ubuntu:
New
Bug description:
I have package A that activated trigger and package B which should be
reconfigured when trigger is activated (listens for trigger). Trigger
is activated by postinst script in package A by using `dpkg-trigger
my-trigger`.
After looking into source code (/usr/sbin/dpkg-reconfigure), I can see
that problem is in method triggers_pending from line 201-206. What
happens is that variable $triggers will contain additional space at
the end of line (not present in 16.04) and so it will satisfy
condition on line 205.
So what happens is following?
1. When dpkg-reconfigure is executed, triggers_pending is called to get information about packages with pending triggers
2. Because of bug, every package will be put into list (packages without pending triggers)
3. At the end, dpkg-reconfigure will call again triggers_pending() and will check of new packages that have pending triggers. But because all packages are on original list, no change is detected and none of pending packages is (re-)configured. This leave original package in trigger-pending state.
How to reproduce?
1. Create package A, and it's postinst script call 'dpkg-trigger A-my-trigger'
2. Create package B, that listens for 'A-my-trigger'
3. Install both packages
4. Do: dpkg-reconfigure A
5. Package A will be left broken and no reconfigure step will be executed for package B
How to fix?
Well, I replaced /usr/sbin/dpkg-reconfigure: if (length $triggers) {
with: if ($triggers !~ /^\s*$/) {
and this solved the problem, except that it introduced additional
problem:
My package A does not use debconf for querying parameters and package
B does. But because dpkg-reconfigure messes with DEBIAN_HAS_FRONTEND
environment variable, the frontend is not started, but instead db_get
questions are posted on console (to user) and reconfiguration is
halted. Currently, I don't know enough debconf system in order to
provide solution for this.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/1594457/+subscriptions
More information about the foundations-bugs
mailing list