diff options
-rw-r--r-- | Bugzilla/DaemonControl.pm | 15 | ||||
-rw-r--r-- | Bugzilla/Quantum/Plugin/BlockIP.pm | 2 | ||||
-rw-r--r-- | Dockerfile | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/Bugzilla/DaemonControl.pm b/Bugzilla/DaemonControl.pm index d99c13259..e35221535 100644 --- a/Bugzilla/DaemonControl.pm +++ b/Bugzilla/DaemonControl.pm @@ -14,7 +14,7 @@ use Bugzilla::Logging; use Bugzilla::Constants qw(bz_locations); use Cwd qw(realpath); use English qw(-no_match_vars $PROGRAM_NAME); -use File::Spec::Functions qw(catfile); +use File::Spec::Functions qw(catfile catdir); use Future::Utils qw(repeat try_repeat); use Future; use IO::Async::Loop; @@ -41,11 +41,13 @@ our %EXPORT_TAGS = ( utils => [qw(catch_signal on_exception on_finish)], ); +use constant BUGZILLA_DIR => realpath(bz_locations->{cgi_path}); + use constant { - JOBQUEUE_BIN => realpath( catfile( bz_locations->{cgi_path}, 'jobqueue.pl' ) ), - CEREAL_BIN => realpath( catfile( bz_locations->{cgi_path}, 'scripts', 'cereal.pl' ) ), - HTTPD_BIN => '/usr/sbin/httpd', - HTTPD_CONFIG => realpath( catfile( bz_locations->{confdir}, 'httpd.conf' ) ), + JOBQUEUE_BIN => catfile( BUGZILLA_DIR, 'jobqueue.pl' ), + CEREAL_BIN => catfile( BUGZILLA_DIR, 'scripts', 'cereal.pl' ), + HYPNOTOAD_BIN => catfile( BUGZILLA_DIR, 'local', 'bin', 'hypnotoad' ), + PERL5LIB => join(':', BUGZILLA_DIR, catdir(BUGZILLA_DIR, 'lib'), catdir(BUGZILLA_DIR, 'local', 'lib', 'perl5'), }; sub catch_signal { @@ -101,7 +103,8 @@ sub run_httpd { my $httpd = IO::Async::Process->new( code => sub { $ENV{BUGZILLA_HTTPD_ARGS} = encode_json(\@args); - my @command = ( 'hypnotoad', '/app/bugzilla.pl', '-f' ); + $ENV{PERL5LIB} = PERL5LIB; + my @command = ( HYPNOTOAD_BIN, catfile(BUGZILLA_DIR, 'bugzilla.pl'), '-f' ); exec @command or die "failed to exec $command[0] $!"; }, diff --git a/Bugzilla/Quantum/Plugin/BlockIP.pm b/Bugzilla/Quantum/Plugin/BlockIP.pm index 57f61c71f..512575b41 100644 --- a/Bugzilla/Quantum/Plugin/BlockIP.pm +++ b/Bugzilla/Quantum/Plugin/BlockIP.pm @@ -11,7 +11,7 @@ my $MEMCACHED = Bugzilla::Memcached->_new()->{memcached}; sub register { my ( $self, $app, $conf ) = @_; - $app->hook(before_routes => \&_before_routes) + $app->hook(before_routes => \&_before_routes); $app->helper(block_ip => \&_block_ip); $app->helper(unblock_ip => \&_unblock_ip); } diff --git a/Dockerfile b/Dockerfile index 412b7c92e..f9baf009d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,6 @@ ENV CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL} ENV CIRCLE_SHA1=${CIRCLE_SHA1} ENV LOG4PERL_CONFIG_FILE=log4perl-json.conf -ENV PATH=/app/local/bin:/opt/rh/sclo-git25/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV PERL5LIB=/app:/app/local/lib/perl5:/app/lib ENV PORT=8000 |