Debugging shell scripts

Janne Jokitalo janne.jokitalo at dnainternet.net
Mon Oct 16 16:35:07 UTC 2006


Hey there,

was just playing with Edgy again, and (re)installing bugzilla. Noticed a 
very peculiar thing. The damn thing wouldn't configure, no matter what I 
tried, it just threw this at me:

root at jjod600n:~# LANG=C DEBIAN_BUGZILLA_DEBUG=1 aptitude reinstall bugzilla
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages will be REINSTALLED:
   bugzilla
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not 
upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up bugzilla (2.22-1) ...
dpkg: error processing bugzilla (--configure):
  subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
  bugzilla
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up bugzilla (2.22-1) ...
dpkg: error processing bugzilla (--configure):
  subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
  bugzilla

Well, then finally I thought that since setting the debug variable before 
running the command isn't working, I should set it inside the 
bugzilla.postinst file, just before it's tested. So I did.

root at jjod600n:/var/lib/dpkg/info# cat bugzilla.postinst | grep DEBIAN
set DEBIAN_BUGZILLA_DEBUG=1

Now, then, let's run the installer again:

root at jjod600n:/var/lib/dpkg/info# aptitude reinstall bugzilla
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages will be REINSTALLED:
   bugzilla
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not 
upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up bugzilla (2.22-1) ...

*blink* *blink* No debug messages. *blink* It just installed without any 
warnings. Only problem is, it still didn't commit all the changes requested 
in the inst-scripts. I had to manually chown /var/lib/bugzilla to www-data.

Can somebody tell me what happened here? Why won't the debug messages show, 
and how setting the debug variable enabled the script run without errors, 
though not fully successful. This is all too weird for me. :)

Thanks in advance for shedding any light in the mystery!


-- 
Jaska






More information about the ubuntu-users mailing list