diff options
Diffstat (limited to 'Bugzilla/DaemonControl.pm')
-rw-r--r-- | Bugzilla/DaemonControl.pm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Bugzilla/DaemonControl.pm b/Bugzilla/DaemonControl.pm index 2c6df1b87..6ff883af0 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; @@ -40,12 +40,11 @@ our %EXPORT_TAGS = ( utils => [qw(catch_signal on_exception on_finish)], ); -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' ) ), -}; +my $BUGZILLA_DIR = bz_locations->{cgi_path}; +my $JOBQUEUE_BIN = catfile( $BUGZILLA_DIR, 'jobqueue.pl' ); +my $CEREAL_BIN = catfile( $BUGZILLA_DIR, 'scripts', 'cereal.pl' ); +my $HTTPD_BIN = '/usr/sbin/httpd'; +my $HTTPD_CONFIG = catfile( bz_locations->{confdir}, 'httpd.conf' ); sub catch_signal { my ($name, @done) = @_; @@ -76,7 +75,7 @@ sub run_cereal { my $loop = IO::Async::Loop->new; my $exit_f = $loop->new_future; my $cereal = IO::Async::Process->new( - command => [CEREAL_BIN], + command => [$CEREAL_BIN], on_finish => on_finish($exit_f), on_exception => on_exception( 'cereal', $exit_f ), ); @@ -103,7 +102,7 @@ sub run_httpd { # we have to setsid() to make a new process group # or else apache will kill its parent. setsid(); - my @command = ( HTTPD_BIN, '-DFOREGROUND', '-f' => HTTPD_CONFIG, @args ); + my @command = ( $HTTPD_BIN, '-DFOREGROUND', '-f' => $HTTPD_CONFIG, @args ); exec @command or die "failed to exec $command[0] $!"; }, @@ -122,7 +121,7 @@ sub run_jobqueue { my $loop = IO::Async::Loop->new; my $exit_f = $loop->new_future; my $jobqueue = IO::Async::Process->new( - command => [ JOBQUEUE_BIN, 'start', '-f', '-d', @args ], + command => [ $JOBQUEUE_BIN, 'start', '-f', '-d', @args ], on_finish => on_finish($exit_f), on_exception => on_exception( 'httpd', $exit_f ), ); |