/etc/cron.daily/bugzilla3 exits with error code 2 when using multiple database configuration

Bug #700967 reported by Stefan Engel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bugzilla (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: bugzilla

Release: Ubuntu 10.04.1 LTS
Package: bugzilla3 3.2.5.1-2

When using multiple database configuration, the daily cron job /etc/cron.daily/bugzilla3 crashes with the following error message:

/etc/cron.daily/bugzilla3:
Can't locate /etc/bugzilla3/site/examplesite in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at -e line 1.
run-parts: /etc/cron.daily/bugzilla3 exited with return code 2

with examplesite beeing a configured bugzilla site.

This is due to line 18 in /etc/cron.daily/bugzilla3:
   paramsf="/etc/bugzilla3/site/$X_BUGZILLA_SITE"
which should be:
   paramsf="/etc/bugzilla3/sites/$X_BUGZILLA_SITE/params"

Furthermore the call of /usr/share/bugzilla3/lib/sanitycheck.pl in line 24 needs the X_BUGZILLA_SITE variable to be exported, else it uses the default configuration in /etc/bugzilla3/params.

The following patch fixes both problems.

--- /etc/cron.daily/bugzilla3 2011-01-10 08:53:09.000000000 +0100
+++ /etc/cron.daily/bugzilla3.fixed 2011-01-10 09:35:53.000000000 +0100
@@ -15,7 +15,7 @@

     if [ -x /usr/share/bugzilla3/lib/sanitycheck.pl ]; then
         if [ "$X_BUGZILLA_SITE" ]; then
- paramsf="/etc/bugzilla3/site/$X_BUGZILLA_SITE"
+ paramsf="/etc/bugzilla3/sites/$X_BUGZILLA_SITE/params"
         else
             paramsf="/etc/bugzilla3/params"
         fi
@@ -31,7 +31,8 @@
 # then the extra sites: /etc/bugzilla3/sites/*
 if [ -d /etc/bugzilla3/sites ]; then
     for site in `cd /etc/bugzilla3/sites && ls -1`; do
- X_BUGZILLA_SITE="$site" doit
+ export X_BUGZILLA_SITE="$site"
+ doit
     done
 fi

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.