Help needed with debconf

أحمد المحمودي aelmahmoudy at users.sourceforge.net
Sat Feb 16 09:40:16 GMT 2008


Hello,

  I'm making a package and I'm using debconf in it, I have attached the 
  postinst, templates & config files I made with this email. The problem 
  is that when I install the resulting deb package I get that error:

  debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by 
  another process: Resource temporarily unavailable

  Can anyone help me to find the cause of this problem ?

  Thanks...

-- 
 أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0x9DCA0B27 (@ subkeys.pgp.net)
 GPG Fingerprint: 087D 3767 8CAC 65B1 8F6C  156E D325 C3C8 9DCA 0B27
-------------- next part --------------
#!/bin/bash
# postinst script for ubuntume-artwork

set -e

# Source debconf library:
. /usr/share/debconf/confmodule

case "$1" in
    configure)
      # Set usplash:
      update-alternatives --set usplash-artwork.so /usr/lib/usplash/ubuntume.so
      update-initramfs -u

      # Set GDM theme:
      update-alternatives --set gdm-config-derivative /usr/share/ubuntume-gdm-themes/gdm-cdd.conf

      # Update login sound:
      #ln -sf /usr/share/sounds/tasmiyah2.wav startup3.wav

      # Set XScreenSaver to use UbuntuME wallpapers:
      db_get ubuntume-artwork/modify-xscreensaverconf
      if [ "$RET" = "true" ]; then
        if grep "^\*imageDirectory" /etc/X11/app-defaults/XScreenSaver-gl > /dev/null 2>&1 ; then
          sed -e 's/^\*imageDirectory.*/\*imageDirectory:  \/usr\/share\/ubuntume-backgrounds/' -i /etc/X11/app-defaults/XScreenSaver-gl
        else
          echo "*imageDirectory:  /usr/share/backgrounds" >> /etc/X11/app-defaults/XScreenSaver-gl
        fi
      fi

      # Set grub splash:
      db_get ubuntume-artwork/modify-grubconf
      if [ "$RET" = "true" ]; then
        if [ ! -e "/boot/grub/device.map" ];
        then
          # device.map doesn't exist yet, ask the user to run dpkg-reconfigure on the package after grub is installed and set and quit the script.

          echo "Cannot find device.map file. Please run \`sudo dpkg-reconfigure ubuntume-artwork\` once Grub is configured on your system.";
          exit 0

        fi

        DISCREF=`df -h /boot | grep dev | sed -e 's/\.*[0-9].*//'`;
        DISCNB=`grep "$DISCREF" /boot/grub/device.map | sed -e 's/).*//'`
        PARTNB=$[`df -h /boot | awk 'BEGIN{ FS=" " } { print $1 "\n" $2 }' | grep dev | sed -e 's/\/dev\/[a-z]*//'`-1];
        GRUBPART="$DISCNB","$PARTNB"\);

        # setting the default splashimage to be installed by the package
        DEFAULTIMG="medine_moon_right_below";

        # initializing boot prefix to /boot by default
        BOOTPREFIX="/boot"
        # detecting if /boot has its own partition
        [[ -z `mount | grep "/boot"` ]] || BOOTPREFIX=""

        SPLASHADD="splashimage=${GRUBPART}${BOOTPREFIX}/grub/splashimages/$DEFAULTIMG.xpm.gz";
        SPLASHSED="splashimage=${GRUBPART}\\${BOOTPREFIX}\/grub\/splashimages\/$DEFAULTIMG.xpm.gz";

        if grep "\s*splashimage\s*=" /boot/grub/menu.lst > /dev/null 2>&1 ; then
          sed -e "s/\s*splashimage\s*=.*/$SPLASHSED/" -i /boot/grub/menu.lst
        else
          echo "$SPLASHADD" >> /boot/grub/menu.lst
        fi

        update-grub
      fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0


-------------- next part --------------
Template: ubuntume-artwork/modify-xscreensaverconf
Type: boolean
Default: true
_Description: Modify XScreenSaver configuration to use Ubuntu Muslim Edition images ?
 That will modify /etc/X11/app-defaults/XScreenSaver-gl in order to use Ubuntu Muslim 
 Edition wallpapers for the GLSlideshow theme.

Template: ubuntume-artwork/modify-grubconf
Type: boolean
Default: true
_Description: Modify Grub configuration to use Ubuntu Muslim Edition Grub splash image ?
 That will modify /boot/grub/menu.list in order to use Ubuntu Muslim Edition 
 Grub splash image
-------------- next part --------------
#!/bin/sh -e

# Source debconf library:
. /usr/share/debconf/confmodule

db_input medium ubuntume-artwork/modify-xscreensaverconf || true
db_input medium ubuntume-artwork/modify-grubconf || true
db_go



More information about the Ubuntu-motu-mentors mailing list