summaryrefslogtreecommitdiffstats
path: root/extensions/Push/lib/Daemon.pm
diff options
context:
space:
mode:
authorPerl Tidy <perltidy@bugzilla.org>2018-12-05 21:38:52 +0100
committerDylan William Hardison <dylan@hardison.net>2018-12-05 23:49:08 +0100
commit8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch)
tree9d270f173330ca19700e0ba9f2ee931300646de1 /extensions/Push/lib/Daemon.pm
parenta7bb5a65b71644d9efce5fed783ed545b9336548 (diff)
downloadbugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz
bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'extensions/Push/lib/Daemon.pm')
-rw-r--r--extensions/Push/lib/Daemon.pm87
1 files changed, 44 insertions, 43 deletions
diff --git a/extensions/Push/lib/Daemon.pm b/extensions/Push/lib/Daemon.pm
index 7f2459a95..7fb5352ca 100644
--- a/extensions/Push/lib/Daemon.pm
+++ b/extensions/Push/lib/Daemon.pm
@@ -20,7 +20,7 @@ use File::Basename;
use Pod::Usage;
sub start {
- newdaemon();
+ newdaemon();
}
#
@@ -28,70 +28,71 @@ sub start {
#
sub gd_preconfig {
- my $self = shift;
- my $pidfile = $self->{gd_args}{pidfile};
- if (!$pidfile) {
- $pidfile = bz_locations()->{datadir} . '/' . $self->{gd_progname} . ".pid";
- }
- return (pidfile => $pidfile);
+ my $self = shift;
+ my $pidfile = $self->{gd_args}{pidfile};
+ if (!$pidfile) {
+ $pidfile = bz_locations()->{datadir} . '/' . $self->{gd_progname} . ".pid";
+ }
+ return (pidfile => $pidfile);
}
sub gd_getopt {
- my $self = shift;
- $self->SUPER::gd_getopt();
- if ($self->{gd_args}{progname}) {
- $self->{gd_progname} = $self->{gd_args}{progname};
- } else {
- $self->{gd_progname} = basename($0);
- }
- $self->{_original_zero} = $0;
- $0 = $self->{gd_progname};
+ my $self = shift;
+ $self->SUPER::gd_getopt();
+ if ($self->{gd_args}{progname}) {
+ $self->{gd_progname} = $self->{gd_args}{progname};
+ }
+ else {
+ $self->{gd_progname} = basename($0);
+ }
+ $self->{_original_zero} = $0;
+ $0 = $self->{gd_progname};
}
sub gd_postconfig {
- my $self = shift;
- $0 = delete $self->{_original_zero};
+ my $self = shift;
+ $0 = delete $self->{_original_zero};
}
sub gd_more_opt {
- my $self = shift;
- return (
- 'pidfile=s' => \$self->{gd_args}{pidfile},
- 'n=s' => \$self->{gd_args}{progname},
- );
+ my $self = shift;
+ return (
+ 'pidfile=s' => \$self->{gd_args}{pidfile},
+ 'n=s' => \$self->{gd_args}{progname},
+ );
}
sub gd_usage {
- pod2usage({ -verbose => 0, -exitval => 'NOEXIT' });
- return 0;
-};
+ pod2usage({-verbose => 0, -exitval => 'NOEXIT'});
+ return 0;
+}
sub gd_redirect_output {
- my $self = shift;
+ my $self = shift;
- my $filename = bz_locations()->{datadir} . '/' . $self->{gd_progname} . ".log";
+ my $filename = bz_locations()->{datadir} . '/' . $self->{gd_progname} . ".log";
+ open(STDERR, ">>", $filename) or (print "could not open stderr: $!" && exit(1));
+ close(STDOUT);
+ open(STDOUT, ">&", STDERR) or die "redirect STDOUT -> STDERR: $!";
+ $SIG{HUP} = sub {
+ close(STDERR);
open(STDERR, ">>", $filename) or (print "could not open stderr: $!" && exit(1));
- close(STDOUT);
- open(STDOUT, ">&", STDERR) or die "redirect STDOUT -> STDERR: $!";
- $SIG{HUP} = sub {
- close(STDERR);
- open(STDERR, ">>", $filename) or (print "could not open stderr: $!" && exit(1));
- };
+ };
}
sub gd_setup_signals {
- my $self = shift;
- $self->SUPER::gd_setup_signals();
- $SIG{TERM} = sub { $self->gd_quit_event(); }
+ my $self = shift;
+ $self->SUPER::gd_setup_signals();
+ $SIG{TERM} = sub { $self->gd_quit_event(); }
}
sub gd_run {
- my $self = shift;
- $::SIG{__DIE__} = \&Carp::confess if $self->{debug};
- my $push = Bugzilla->push_ext;
- $push->logger->{debug} = $self->{debug};
- $push->is_daemon(1);
- $push->start();
+ my $self = shift;
+ $::SIG{__DIE__} = \&Carp::confess if $self->{debug};
+ my $push = Bugzilla->push_ext;
+ $push->logger->{debug} = $self->{debug};
+ $push->is_daemon(1);
+ $push->start();
}
1;