On Mon, Dec 18, 2006 at 04:29:10AM +0100, Peter Palfrader wrote:
>On Mon, 18 Dec 2006, Steve McIntyre wrote:
>
>> >Only enabling it using dpkg-reconfigure makes changes persistent accross
>> >upgrades.
>> 
>> Pardon me for being dense, but I don't see a way in the postinst of
>> knowing whether I'm being called via dpkg-reconfigure. Any clues?
>
>I don't think your postint needs to care.  As I understand the
>debconf-devel(7) manual page (section 'Config file handling') you need
>to find out the current status of the system in your .config file, then
>use db_set to inform debconf about that status, so you can use it in
>your postinst script.

Yeah, OK. That's the bit I was missing. I can see that the postinst is
called again, though...

>In fact you already appear to be doing at least some db_sets in your
>.config maintainer script, only CVS_ENAB_PSERV somehow needs to get
>properly set based on the current inetd.conf.
>
>Something like this fixes the enable/disable problem:
>
>--- cvs.config.orig    2006-12-18 04:13:03.766969143 +0100
>+++ /var/lib/dpkg/info/cvs.config      2006-12-18 04:13:15.000000000 +0100
>@@ -49,13 +49,10 @@
>     if [ "$CVS_PSERV_RESPAWN" ]; then
>         db_set cvs/pserver_spawnlimit "$CVS_PSERV_RESPAWN" || true
>     fi
>-    if [ "$CVS_ENAB_PSERV" ]; then
>-        CVS_ENAB_PSERV=`echo "$ENAB_PSERV" | tr A-Z a-z`
>-        if [ "$CVS_ENAB_PSERV" = "yes" ]; then
>-            db_set cvs/pserver true || true
>-        else
>-            db_set cvs/pserver false || true
>-        fi
>+    if grep -q '^cvspserver' /etc/inetd.conf; then
>+        db_set cvs/pserver true || true
>+    else
>+        db_set cvs/pserver false || true
>     fi
>     if [ "$OTHER_ROTKEEP" ]; then
>         db_set cvs/rotatekeep "$OTHER_ROTKEEP" || true
>
>[It seems update-inetd has no method to query the status of a service.  Eww.]

Yeah, that does seem like quite an omission :-(

>However, this does not fix all of the cvs package's problems.  For
>instance the spawn limit is not read back either, resulting again in
>manual config changes being lost on upgrades:

<snip>

>Another, related problem is the following:

<snip>

>That is, enabling pserver, when it is commented out with just a '#' does
>not work.  The reason for this is that update-inetd only touches lines
>starting with '#<off># ' or the service port.  It ignored lines that are
>commented out:

<snip>

Yup.

>I realize that fixing all this in time for etch will be hard.  It would
>be nice if the enable/disable change on upgrades could be fixed.  The
>other items probably are better left for later.  If you agree please
>clone the bug and handle them sepeartly.

To be honest, I'm beginning to think that trying to manage the inetd
entries using debconf is actually a mistake and doomed to
failure. Maybe the first time the package is installed, it can be
correct and accurate, but later on it's not possible to do things
correctly.

-- 
Steve McIntyre, Cambridge, UK.                                [EMAIL PROTECTED]
  Armed with "Valor": "Centurion" represents quality of Discipline,
  Honor, Integrity and Loyalty. Now you don't have to be a Caesar to
  concord the digital world while feeling safe and proud.


Reply via email to