[Debconf-devel] Bug#855912: db_purge: exits with error code 8 when using deluser in the same postinst

Colin Watson cjwatson at debian.org
Sun May 21 17:32:59 UTC 2017


Control: severity -1 normal
Control: merge 782463 -1

On Tue, Apr 11, 2017 at 03:53:00PM +0000, Niels Thykier wrote:
> Have you had a chance to review this bug?  AFAICT, it got
> clone+reassigned without you explicitly being CC'ed, so I am leaving the
> full mail quoted below for your sake.

Sorry, yes.  This is basically the same as #782463, and it doesn't need
to be RC since it's been the case forever.  For that matter it's more or
less the same as the gotcha documented in debconf-devel(7), albeit for
the postinst rather than the postrm (but the considerations are
basically the same):

       *      Avoid outputting anything to stdout in your postinst,
              since that can confuse debconf, and postinst should not
              be verbose anyway. Output to stderr is ok, if you must.

Another good workaround for this type of problem, and Maximiliano, this
is something you should do anyway in sddm, is to put:

  . /usr/share/debconf/confmodule

... at the *top* of your postrm, just below the #! line and any "set -e"
or similar command, even if dh_installdebconf also inserts a fragment
later that includes that line.  That way, the confmodule's redirection
of stdout to stderr will take effect early enough to be useful.  Often
more importantly, this avoids problems caused by the fact that sourcing
the confmodule re-execs the calling script, which can cause weird
problems if you weren't expecting all the code before the confmodule is
sourced to be called twice, which you probably weren't.  This is
documented under HACKS in debconf-devel(7).

Thanks,

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the Debconf-devel mailing list