Nice ideas Thorsten. You're right that maybe USAGE_MODE_CMDLINE has not been designed for our case (though this is what scmbug has been using so far). However I'm not sure about USAGE_MODE_BROWSER either (it turns on some browser-specific activities like some templates processing or could issue some interactive inquiries to user. Error reporting is also affected). This has been designed for running Bugzilla within web container (as CGI, MOD_PERL, etc) and expecting interactive browser-based interaction with end-user.
* Frankly speaking, I'm not sure which usage_mode would be best for Scmbug - seems none of the available options fits precisely. Unless we managed to discover something appropriate maybe it would be best to collaborate with Bugzilla team for that. As per Bugzilla.pm docs: Call either C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> or C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near the beginning of your script to change this flag's default of C<Bugzilla::Constants::USAGE_MODE_BROWSER> and to indicate that Bugzilla is being called in a non-interactive manner. So maybe USAGE_MODE_XMLRPC would be the best workaround for now (this however turns on some SOAP-specific processing of errors which I'm not sure would be appropriate). * I'm not yet sure why does USAGE_MODE_CMDLINE fail now (could be some Bugzilla bug). Regards, Yavor 2011/3/3 Adam Noon <[email protected]> > Hi Thorston, > > Thank you for this suggestion. I reverted the code in Bugzilla.pm and set > the SERVER_SOFTWARE environment variable in the Scmbug scmbug-server.bat > script. > > I'm happy to report that this worked a treat and the deamon is executing > fine! > > Cheers, > Adam > > Sent from my iPhone > > On 3 Mar 2011, at 11:48, "Thorsten Schöning" <[email protected]> > wrote: > > > Guten Tag Yavor Nikolov, > > am Mittwoch, 2. März 2011 um 16:43 schrieben Sie: > > > >> I think USAGE_MODE_CMDLINE is the right mode to be used with Scmbug. > > > > I don't think so, collectstats.pl etc. are not designed as stand alone > > deamons, but applications which are started from a console or cron. As > > the problem didn't occur before, USAGE_MODE_CMDLINE shoudl be, > > therefore there is code somehwere in Bugzilla which checks the usage > > mode and sets it. This should tell what is different between Apache > > and SCMBug. > > > > There's a new sub Bugzilla::usage_mode with following documentation: > > > >> =item C<usage_mode> > > > >> Call either > C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> > >> or C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near > the > >> beginning of your script to change this flag's default of > >> C<Bugzilla::Constants::USAGE_MODE_BROWSER> and to indicate that Bugzilla > is > >> being called in a non-interactive manner. > > > > The documented default differs to what seems to cause the problem, it > > should bew USAGE_MODE_BROWSER, which surely will work as before. > > > > The code: > > > >> sub usage_mode { > >> my ($class, $newval) = @_; > >> if (defined $newval) { > >> if ($newval == USAGE_MODE_BROWSER) { > >> $class->error_mode(ERROR_MODE_WEBPAGE); > >> } > >> elsif ($newval == USAGE_MODE_CMDLINE) { > >> $class->error_mode(ERROR_MODE_DIE); > >> } > >> elsif ($newval == USAGE_MODE_XMLRPC) { > >> $class->error_mode(ERROR_MODE_DIE_SOAP_FAULT); > >> } > >> elsif ($newval == USAGE_MODE_JSON) { > >> $class->error_mode(ERROR_MODE_JSON_RPC); > >> } > >> elsif ($newval == USAGE_MODE_EMAIL) { > >> $class->error_mode(ERROR_MODE_DIE); > >> } > >> elsif ($newval == USAGE_MODE_TEST) { > >> $class->error_mode(ERROR_MODE_TEST); > >> } > >> else { > >> ThrowCodeError('usage_mode_invalid', > >> {'invalid_usage_mode', $newval}); > >> } > >> $class->request_cache->{usage_mode} = $newval; > >> } > >> return $class->request_cache->{usage_mode} > >> || (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE); > >> } > > > > If SCMBug doesn't call usage_mode, it's call in Bugzilla init code > > defaults to guessing it itself and this guess will result in > > USAGE_MODE_CONSOLE because of the call to i_am_cgi: > > > >> sub i_am_cgi { > >> # I use SERVER_SOFTWARE because it's required to be > >> # defined for all requests in the CGI spec. > >> return exists $ENV{'SERVER_SOFTWARE'} ? 1 : 0; > >> } > > > > Adam, could you try to revert your change to Bugzilla and start SCMBug > > with the env variable SERVER_SOFTWARE set to 1 in the SCMBug start > > script? If this works, Kristis may have to options: Issue a call to > > Bugzilla::usage_mode with USAGE_MODE_BROWSER before doing anything > > else with Bugzilla or defining the env variable before using Bugzilla. > > > > Mit freundlichen Grüßen, > > > > Thorsten Schöning > > > > -- > > Thorsten Schöning > > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig > > > > Telefon: Potsdam: 0331-743881-0 > > E-Mail: [email protected] > > Web: http://www.am-soft.de > > > > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam > > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow > > > > _______________________________________________ > > scmbug-users mailing list > > [email protected] > > http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users > _______________________________________________ > scmbug-users mailing list > [email protected] > http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users >
_______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
