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

Re: Suivre un script pas à pas - Debconf et Webcalendar



Guillaume Yziquel a écrit :
> Guillaume Yziquel a écrit :
> 
> Bon. Ben, je me suis résigné à insérer manuellement le fichier sourcé.
> Et j'ai lancé bashdb:
> 
>> yziquel@seldon:~/Desktop$ bashdb webcalendar.prerm
>> [...]
>>  15:==>if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
>> Debugged program terminated with code 10. Use q to quit or R to restart.
>> bashdb<3>
> 
> Ben ça plante bien vite, tout ça! Et je sais pas trop où aller chercher
> l'information de ce que signifie ce code d'erreur. S'agit-il de "if" ou
> de "["?

Concernant le code d'erreur, il me semble, d'après le "Shell and
Utilities volume (XCU)" de la "Version 3 of the Single UNIX Specification",

	http://www.unix.org/version3/online.html

que

> The if Conditional Construct
> 
> The if command shall execute a compound-list and use its exit status to determine whether to execute another compound-list.
> 
> The format for the if construct is as follows:
> 
>     if compound-listthen
>         compound-list[elif compound-listthen
>         compound-list] ...
>     [else
>         compound-list]
> 
> 
>     fi
> 
> The if compound-list shall be executed; if its exit status is zero, the then compound-list shall be executed and the command shall complete. Otherwise, each elif compound-list shall be executed, in turn, and if its exit status is zero, the then compound-list shall be executed and the command shall complete. Otherwise, the else compound-list shall be executed.
> Exit Status
> 
> The exit status of the if command shall be the exit status of the then or else compound-list that was executed, or zero, if none was executed.

De plus, l'option -X de bashdb permet de tracer ligne à ligne
l'exécution, et on obtient un message d'erreur un peu plus parlant:

> yziquel@seldon:~/Desktop$ bashdb -X webcalendar.prerm
> Bourne-Again Shell Debugger, release bash-3.1-0.06
> Copyright 2002, 2003, 2004, 2006 Rocky Bernstein
> This is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> 
> (/usr/bin/bashdb:272):
> level 1, subshell 0, depth -1:  . $_source_file
> (/home/yziquel/Desktop/webcalendar.prerm:3):
> level 1, subshell 0, depth 0:   set -e
> (/home/yziquel/Desktop/webcalendar.prerm:15):
> level 1, subshell 0, depth 0:   if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
> (/home/yziquel/Desktop/webcalendar.prerm:16):
> level 1, subshell 0, depth 0:   PERL_DL_NONLAZY=1
> (/home/yziquel/Desktop/webcalendar.prerm:17):
> level 1, subshell 0, depth 0:   export PERL_DL_NONLAZY
> (/home/yziquel/Desktop/webcalendar.prerm:20):
> level 1, subshell 0, depth 0:   if [ "$DEBCONF_USE_CDEBCONF" ]; then
> (/home/yziquel/Desktop/webcalendar.prerm:23):
> level 1, subshell 0, depth 0:   exec /usr/share/debconf/frontend $0 "$@"
> debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission non accordée
> yziquel@seldon:~/Desktop$

Ouais. De toute façon, ce genre de script doit s'exécuter en root, non?

Le message suivant, qui apparaît avec la manipulation à la fin semble se
rapprocher du problème.

> sanity check failed for dbc_command.
> error encountered determining package or command:
> dbconfig-common can not determine the maintainer script running it.

Ceci semble bien rejoindre ce que Jean-Yves Barbier disait:

> mais le code d'erreur vient toujours du dernier exécuté; donc soit c'est
> lui qui a un PB, soit les résultats (passage de parms, ou récup' de variables
> d'environnement) qu'il a reçu sont erronées 

La manipulation:

> yziquel@seldon:~$ su -
> Password:
> seldon:~# bashdb -X /var/lib/dpkg/info/webcalendar.prerm
> Bourne-Again Shell Debugger, release bash-3.1-0.06
> Copyright 2002, 2003, 2004, 2006 Rocky Bernstein
> This is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> 
> (/usr/bin/bashdb:272):
> level 1, subshell 0, depth -1:  . $_source_file
> (/var/lib/dpkg/info/webcalendar.prerm:3):
> level 1, subshell 0, depth 0:   set -e
> (/var/lib/dpkg/info/webcalendar.prerm:5):
> level 1, subshell 0, depth 0:   . /usr/share/debconf/confmodule

Puis:

> seldon:~# /var/lib/dpkg/info/webcalendar.prerm
> sanity check failed for dbc_command.
> error encountered determining package or command:
> dbconfig-common can not determine the maintainer script running it.

Et enfin:

> seldon:~# logout
> yziquel@seldon:~$ cd Desktop/
> yziquel@seldon:~/Desktop$ su
> Password:
> seldon:/home/yziquel/Desktop# bashdb -X webcalendar.prerm
> Bourne-Again Shell Debugger, release bash-3.1-0.06
> Copyright 2002, 2003, 2004, 2006 Rocky Bernstein
> This is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> 
> (/usr/bin/bashdb:272):
> level 1, subshell 0, depth -1:  . $_source_file
> (/home/yziquel/Desktop/webcalendar.prerm:3):
> level 1, subshell 0, depth 0:   set -e
> (/home/yziquel/Desktop/webcalendar.prerm:15):
> level 1, subshell 0, depth 0:   if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
> (/home/yziquel/Desktop/webcalendar.prerm:16):
> level 1, subshell 0, depth 0:   PERL_DL_NONLAZY=1
> (/home/yziquel/Desktop/webcalendar.prerm:17):
> level 1, subshell 0, depth 0:   export PERL_DL_NONLAZY
> (/home/yziquel/Desktop/webcalendar.prerm:20):
> level 1, subshell 0, depth 0:   if [ "$DEBCONF_USE_CDEBCONF" ]; then
> (/home/yziquel/Desktop/webcalendar.prerm:23):
> level 1, subshell 0, depth 0:   exec /usr/share/debconf/frontend $0 "$@"
> seldon:/home/yziquel/Desktop#

Bon. À creuser. /usr/share/debconf/frontend est bien un fichier en
Perl... Encore de la documentation à lire en perspective...

Merci pour vos indications instructives.

Guillaume Yziquel.



Reply to: