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

debconf/dpkg bleibt im postinst Script hängen



Hallo,

ich habe ein Problem mit meinem Postinstall Script. Es bleibt einfach beim 
installieren mittels dpkg -i hängen.
Das sieht dann wie folgt bei "ps xfa" aus.

11291 pts/1    S+     0:00  |               \_ dpkg -i 
antzsystem-dispatcher_2.1_i386.deb
11301 pts/1    S+     0:00  |                   \_ /usr/bin/perl 
-w /usr/share/debconf/frontend /var/lib/dpkg/info/antzsystem-dispatcher.postinst 
configure
11311 pts/1    Z+     0:00  |                       \_ [antzsystem-disp] 
<defunct>


Dieses Paket führt nach dem Postinst noch ein init.d Script zum Starten aus. 
Dieses Script habe ich auch schon mittels "set -x" debugged und es läuft bis 
zum Ende durch und liefert auch ein "exit 0".
*****letzten paar Zeilen*******
+ local _LINE
+ read -r _LINE
+ RET=antz
+ return 0
+ '[' -z antz ']'
+ sed -e s/@USER@/antz/g /usr/share/antz/antzsystem.in
+ ANTZUSER=antz
+ add_user_if_missing antz
+ '[' -x /usr/sbin/adduser ']'
+ id -u antz
+ chown -R antz /var/log/antzsystem
+ chown -R antz /var/run/antzsystem
+ exit 0
*****************************

das zugehörige Postinst Script sieht wie folgt aus:
***********************************
#!/bin/sh
set -e

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

#DEBHELPER#
if [ "$1" != "configure" -a "$1" != "install" ]; then
    exit 0
fi

add_user_if_missing()
{
    if [ -x /usr/sbin/adduser ]; then
        if ! id -u $1 > /dev/null 2>&1; then
            adduser --no-create-home --disabled-password --force-badname $1
        fi
    fi
}


db_get antz/disp_name
if [ ! -z "$RET" ]; then
    sed -e "s/@SYSNAME@/$RET/g" /usr/share/antz/dispatcher.conf.in 
> /etc/antzsystem/dispatcher.conf
fi
db_get antz/interdisp_list
if [ ! -z "$RET" ]; then
    SAVEIFS=$IFS
    IFS=" "
    j=0
    for i in ${RET}; do
        j=$(($j + 1))
        echo "$j=$i" >> /etc/antzsystem/dispatcher.conf
    done
    IFS=$SAVEIFS
fi

db_get antz/antzuser
if [ -z "$RET" ]; then
    echo "Error, no user defined for running antzsystem"
    exit 1
else
    sed -e "s/@USER@/$RET/g" /usr/share/antz/antzsystem.in 
> /etc/default/antzsystem
fi
ANTZUSER=$RET

add_user_if_missing "$ANTZUSER"
chown -R "$ANTZUSER" /var/log/antzsystem
chown -R "$ANTZUSER" /var/run/antzsystem
exit 0
***********************************

Leider habe ich überhaupt keine Idee mehr was da schief laufen könnte. Und mir 
fällt auch keine weitere Diagnose Möglichkeit ein.

Jemand irgend eine Idee was da noch falsch laufen könnte bzw. wie ich das 
Problem weiter untersuchen könnte?
Das ganze geht im übrigen auf allen Maschinen schief die ich bisher so unter 
die Finger bekommen konnte, das waren UML/Sarge-Maschinen und weitere 
Sid/Sarge i386er Maschinen.

Markus Schulz



Reply to: