[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Preseed a bunch of pacakges from a debain pacakge



Hello,
I am trying to pressed a bunch of packages from a single package and
have come across this following error.
Searching for the error led me some posts that essential pointed the
user to repairing their debconf-db, which i am pretty sure is not the
case.

This behavior was observed on a fresh installation of debian and is
reproducible. I will get back to you, if you want to know if the error
is always on the same line (sorry).

Firstly the error log

+ (( HOSTNAME_NEEDED ))
+ (( ROOT_PW_NEEDED ))
+ ’[’ 1 -ne 1 ’]’
debconf: DbDriuer "config": /var/cache/debconf/config.dat is locked by
another process: Resource temporarily unavailable
dpkg: error processing /cdrom//deepofix/deepofix-packages/deepofix_0.2_all.deb
subprocess new pre-installation script returned exit status 1
configured to not write apport reports
Use of uninitialized value $pacakge in concatenation (.) or string at
/usr/share/debconf/frontend line 65.
Use of uninitialized value $package in length at
/usr/share/debconf/frontend line 66.
Errors were encountered while
processing:/cdrom//deepofix/deepofix-packages/deepofix_0.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


code@sekon:~/deepofix/packages-dev/dOod/frontend/DEBIAN$ for FILE in
$FILES; do  echo $FILE; cat $FILE; done
postinst
#!/bin/sh -eu

function create_admin_homedir()
{
        if [ ! -d /home/admin ]
        then
                echo "FIXME: Creating home directory for the admin
user, assuming admin's uid is 1000:1000"
                cp -r /etc/skel /home/admin && chown 1000:1000 /home/admin -R
        fi
}

create_admin_homedir

if [ -e /etc/default/locale ]; then
        echo "/etc/default/locale exists .. leaving it unchanged"
else
        touch /etc/default/locale;
        echo LANG="en_US.UTF-8" > /etc/default/locale;
        echo LANGUAGE="en_US:en" >> /etc/default/locale;
fi

preinst
#!/bin/bash

# Source debconf library.
. /usr/share/debconf/confmodule || exit 1

db_get deepOfix/ip
test ! -z "$RET" && IPADDRD="$RET"

db_get deepOfix/subnet
test ! -z "$RET" && SUBNET="$RET"

db_get deepOfix/dnsserver
test ! -z "$RET" && DNSSERV="$RET"

db_get deepOfix/domain
test ! -z "$RET" && DOMAIN="$RET"

db_get deepOfix/orgname
test ! -z "$RET" && ORGNAME="$RET"

db_get deepOfix/bindpw
test ! -z "$RET" && BIND_PASSWORD="$RET"

db_get deepOfix/old_rootpw
test ! -z "$RET" && OLD_ROOTPW="$RET"

db_get deepOfix/new_rootpw
test ! -z "$RET" && NEW_ROOTPW="$RET"

db_get deepOfix/new_rootpw_again
test ! -z "$RET" && NEW_ROOTPW_AGAIN="$RET"

db_get deepOfix/hostname
test ! -z "$RET" && MYHOSTNAME="$RET"

db_get deepOfix/timezone
test ! -z "$RET" && TIMEZONE="$RET"

db_get deepOfix/rootdn
test ! -z "$RET" && ROOT_USER_DN="$RET"

db_get deepOfix/isinstaller
test ! -z "$RET" && IS_INSTALLER="$RET"

db_get deepOfix/mysql_root_password
test ! -z "$RET" && MYSQL_ROOT_PW="$RET"

ip_address=$IPADDR
netmask=$SUBNET
gateway=$GATEWAY
dns_server=$DNSSERV
domain_name=$DOMAIN
org_name=$ORGNAME
unpriv_password=$BIND_PASSWORD
root_password=$NEW_ROOTPW
hostname=$MYHOSTNAME
timezone=$TIMEZONE

# Now we set debconf values ..
#        (
#                echo "deepofix-apache2-config
deepofix-apache2-config/apache2_enabled boolean true"
#                echo "deepofix-apache2-config
deepofix-apache2-config/apache2_ssl boolean true"
#                echo "deepofix-network-config
deepofix-network-config/firewall_enabled boolean true"
#                echo "deepofix-auth-config
deepofix-auth-config/backend select LDAP"
#                echo "deepofix-network-config
deepofix-network-config/local_ipaddress string $ip_address"
#                echo "deepofix-network-config
deepofix-network-config/local_netmask string $netmask"
#                echo "deepofix-network-config
deepofix-network-config/local_gateway string $gateway"
#                echo "deepofix-network-config
deepofix-network-config/dnsserver string $dns_server"
#                echo "deepofix-openldap-config
deepofix-openldap-config/root_password password $root_password"
#                echo "deepofix-openldap-config
deepofix-openldap-config/unpriv_password password $unpriv_password"
#                echo "deepofix-openldap-config
deepofix-openldap-config/domain string $domain_name"
#                echo "deepofix-djbdns-config
deepofix-djbdns-config/dnscache/ipaddress string $ip_address"
#                echo "deepofix-qmail-ldap-config
deepofix-qmail-ldap-config/unpriv_password password $unpriv_password"
#                echo "deepofix-qmail-ldap-config
deepofix-qmail-ldap-config/domain string $domain_name"
#                echo "deepofix-auth-config
deepofix-auth-config/password password $unpriv_password"
#                echo "deepofix-auth-config
deepofix-auth-config/domain string $domain_name"
#                echo "deepofix-courier-config
deepofix-courier-config/password password $unpriv_password"
#                echo "deepofix-courier-config
deepofix-courier-config/domain string $domain_name"
#                echo "deepofix-easypush-config
deepofix-easypush-config/root_password password $root_password"
#                echo "deepofix-easypush-config
deepofix-easypush-config/org_name string $org_name"
#                echo "deepofix-server-config
deepofix-server-config/hostname string $hostname"
#                echo "deepofix-server-config
deepofix-server-config/domain_name string $domain_name"
#                echo "deepofix-server-config
deepofix-server-config/timezone string $timezone"
#                echo "deepofix-dovecot-config
deepofix-dovecot-config/domain_name string $domain_name"
#                echo "deepofix-dovecot-config
deepofix-dovecot-config/password password $unpriv_password"
#                echo "deepofix-sogo-config
deepofix-sogo-config/domain_name string $domain_name"
#                echo "deepofix-sogo-config
deepofix-sogo-config/password password $unpriv_password"
#                echo "deepofix-sogo-config
deepofix-sogo-config/timezone string $timezone"
#                echo "deepofix-sogo-config
deepofix-sogo-config/root_password password $root_password"
#
#        ) | debconf-set-selections

set -ex

#db_set deepofix-apache2-config/apache2_enabled boolean true
#db_set deepofix-apache2-config/apache2_ssl boolean true
#db_set deepofix-network-config/firewall_enabled boolean true
#db_set deepofix-auth-config/backend select LDAP
#db_set deepofix-network-config/local_ipaddress string $ip_address
#db_set deepofix-network-config/local_netmask string $netmask
#db_set deepofix-network-config/local_gateway string $gateway
#db_set deepofix-network-config/dnsserver string $dns_server
#db_set deepofix-openldap-config/root_password password $root_password
#db_set deepofix-openldap-config/unpriv_password password $unpriv_password
#db_set deepofix-openldap-config/domain string $domain_name
#db_set deepofix-djbdns-config/dnscache/ipaddress string $ip_address
#db_set deepofix-qmail-ldap-config/unpriv_password password $unpriv_password
#db_set deepofix-qmail-ldap-config/domain string $domain_name
#db_set deepofix-auth-config/password password $unpriv_password
#db_set deepofix-auth-config/domain string $domain_name
#db_set deepofix-courier-config/password password $unpriv_password
#db_set deepofix-courier-config/domain string $domain_name
#db_set deepofix-easypush-config/root_password password $root_password
#db_set deepofix-easypush-config/org_name string $org_name
#db_set deepofix-server-config/hostname string $hostname
#db_set deepofix-server-config/domain_name string $domain_name
#db_set deepofix-server-config/timezone string $timezone
#db_set deepofix-dovecot-config/domain_name string $domain_name
#db_set deepofix-dovecot-config/password password $unpriv_password
#db_set deepofix-sogo-config/domain_name string $domain_name
#db_set deepofix-sogo-config/password password $unpriv_password
#db_set deepofix-sogo-config/timezone string $timezone
#db_set deepofix-sogo-config/root_password password $root_password


db_set deepofix-apache2-config/apache2_enabled true
db_set deepofix-apache2-config/apache2_ssl true
db_set deepofix-network-config/firewall_enabled true
db_set deepofix-auth-config/backend LDAP
db_set deepofix-network-config/local_ipaddress $ip_address
db_set deepofix-network-config/local_netmask $netmask
db_set deepofix-network-config/local_gateway $gateway
db_set deepofix-network-config/dnsserver $dns_server
db_set deepofix-openldap-config/root_password $root_password
db_set deepofix-openldap-config/unpriv_password $unpriv_password
db_set deepofix-openldap-config/domain $domain_name
db_set deepofix-djbdns-config/dnscache/ipaddress $ip_address
db_set deepofix-qmail-ldap-config/unpriv_password $unpriv_password
db_set deepofix-qmail-ldap-config/domain $domain_name
db_set deepofix-auth-config/password $unpriv_password
db_set deepofix-auth-config/domain $domain_name
db_set deepofix-courier-config/password $unpriv_password
db_set deepofix-courier-config/domain $domain_name
db_set deepofix-easypush-config/root_password $root_password
db_set deepofix-easypush-config/org_name $org_name
db_set deepofix-server-config/hostname $hostname
db_set deepofix-server-config/domain_name $domain_name
db_set deepofix-server-config/timezone $timezone
db_set deepofix-dovecot-config/domain_name $domain_name
db_set deepofix-dovecot-config/password $unpriv_password
db_set deepofix-sogo-config/domain_name $domain_name
db_set deepofix-sogo-config/password $unpriv_password
db_set deepofix-sogo-config/timezone $timezone
db_set deepofix-sogo-config/root_password $root_password
config
#!/bin/bash -xe
# Source debconf library.
. /usr/share/debconf/confmodule || exit 1
if [[ `ls -l /bin/sh | cut -d " " -f 11 ` == "dash" || `ls -l /bin/sh
| cut -d " " -f 11 ` == "/bin/dash" ]]; then rm /bin/sh;ln -s
/bin/bash /bin/sh;echo "ALERT: replaced /bin/dash with /bin/bash as
the symbolic link from /bin/sh"; fi

is_ip_valid()
{
        ## Returns 1 if IP *looks* valid, else returns 0
        if [ -z $1 ]
        then
                return 0
        fi
        IP=$1
        count=0
        valid=1
        IP=`echo $IP|tr '.' ' '`
        for part in $IP
        do
                if (( valid ))
                then
                        if [ "`echo $part | egrep ^[[:digit:]]+$`" = "" ]
                        then
                                valid=0
                                continue
                        fi
                        if [ $part -le 255 ]
                        then
                                valid=1
                        else
                                valid=0
                        fi
                        count=$(expr $count + 1)
                fi
         done
         if [ $count -ne 4 ]
        then
                valid=0
        else
                valid=1
         fi

                return $valid;
}



## First we define what information is needed.
IP_NEEDED=1
SUBNET_NEEDED=1
GATEWAY_NEEDED=1
DNS_NEEDED=1
HOSTNAME_NEEDED=1
DOMAIN_NEEDED=1
ORG_NAME_NEEDED=1
ROOT_PW_NEEDED=1
BIND_PASSWORD_NEEDED=1
TIMEZONE_NEEDED=1

## Misc init ##
NSS_LDAP_FILE="/etc/libnss-ldap.conf"
IP_MULTIPROMPT=0 ##TODO
LDAP=0 ## if ldap already exists on the system , 0 says it dosent. ##TODO
PAM_FILES_NOT_OK=0 ## all required pam files (/etc/pam.d/common-*) for
ldap auth in deepOfix environment exists
MYSQL_ADMIN_EXISTS=0 #A flag variable, used to indicate if mysql
command exists on the system.
PWGEN_EXISTS=0 # A flag variable, used to indicate if pwgen command
exists on the system
MYSQL_DONE=0  # A flag variable, used to indicate that the mysqladmin
failed to set the password.
LDAP_COUNT=0  # A variable used to see if all the PAM-LDAP files are required.
PAM_FILES_COUNT=5 # no of PAM related files count that is expected


# Input Priority
# --> Highest priority is inputted debconf values
# --> Next is information that is discovered
# --> Next is an explicit prompt for information

## For root password .. we take an optional old root password and
change it to new passsword, if none is provided then we have to
## ask them for the password and change it to the new password.
## ask them for the password and change it to the new password. Things
to change the root password for
## (a) The system
## (b) mysql


##  Now the main vars
IPADDR=""
SUBNET=""
GATEWAY=""
DNSSERV=""
DOMAIN=""
ORGNAME=""
BIND_PASSWORD=""
OLD_ROOTPW="" ## Required for LDAP password change.
NEW_ROOTPW=""
NEW_ROOTPW_AGAIN=""
MYHOSTNAME=""
TIMEZONE=""
IS_INSTALLER=""
ROOT_USER_DN="" #The dn of the root user on the system.
MYSQL_ROOT_PW=""

if [ -z "$IS_INSTALLER" ]
then
            db_get deepOfix/isinstaller
            test ! -z "$RET" && IS_INSTALLER="$RET"
            ## if $IS_INSTALLER is 1, set *_NEEDED to zero and get all
values from debconf.
            if [ "$IS_INSTALLER" == "true" ]
            then
                echo "Detected: Installing from installer"
                echo "Will be using debconf values without checking
their validity"
                IP_NEEDED=0
                SUBNET_NEEDED=0
                GATEWAY_NEEDED=0
                DNS_NEEDED=0
                HOSTNAME_NEEDED=0
                DOMAIN_NEEDED=0
                ORG_NAME_NEEDED=0
                ROOT_PW_NEEDED=0
                BIND_PASSWORD_NEEDED=0
                TIMEZONE_NEEDED=0
                ## set IS_INSTALLER to 1
                IS_INSTALLER=1
            fi
fi

## PLACE HOLDER FOR DEEPOFIX-DEBCONF SELECTION RETRIVAL ##
##############################
<SNIP>IMO, Irrevelant parts </SNIP>
######################################
if (( ROOT_PW_NEEDED ))
then
        db_input high deepOfix/new_rootpw || true
        db_go
        db_get deepOfix/new_rootpw
        test ! -z "$RET" && NEW_ROOTPW="$RET"
fi

## now we check if IP,subnet,gateway and DNS are valid values
if [ $IS_INSTALLER -ne 1 ]
then
        # Installer already validates these values.
        IS_VALID=0
        is_ip_valid "$IPADDR"
        IS_VALID=$?
        if (( ! IS_VALID ))
        then
                db_input high deepOfix/ip_not_valid_note || true
                db_go
                exit 255
        fi
        is_ip_valid "$SUBNET"
        IS_VALID= $?
        if (( ! IS_VALID ))
        then
                db_input high deepOfix/subnet_not_valid_note || true
                db_go
                exit 255
        fi
        is_ip_valid "$GATEWAY"
        IS_VALID= $?
        if (( ! IS_VALID ))
        then
                db_input high deepOfix/gateway_not_valid_note || true
                db_go
                exit 255
        fi
        is_ip_valid "$DNSSERV"
        IS_VALID= $?
        if (( ! IS_VALID ))
        then
                db_input high deepOfix/dns_not_valid_note || true
                db_go
                exit 255
        fi
fi


Reply to: