Skip to content
Browse files

Add PID_DIR config option

  • Loading branch information...
1 parent cbf12e3 commit 9e0d81cc5e6ade36a527f8a197f7cc3b8c9376a2 @xdg xdg committed
Showing with 3 additions and 1 deletion.
  1. +1 −0 lib/PAUSE.pm
  2. +2 −1 lib/PAUSE/mldistwatch.pm
View
1 lib/PAUSE.pm
@@ -80,6 +80,7 @@ $PAUSE::Config ||=
MOD_DATA_SOURCE_NAME => "dbi:mysql:mod",
NO_SUCCESS_BREAK => 900,
P5P => 'release-announce@perl.org',
+ PID_DIR => "/var/run/",
PAUSE_LOG => "/home/k/PAUSE/log/paused.log",
PAUSE_LOG_DIR => "/home/k/PAUSE/log/",
PAUSE_PUBLIC_DATA => '/home/ftp/pub/PAUSE/PAUSE-data',
View
3 lib/PAUSE/mldistwatch.pm
@@ -19,6 +19,7 @@ use ExtUtils::Manifest;
use Fcntl qw();
use File::Basename ();
use File::Copy ();
+use File::Spec ();
use File::Temp 0.14 (); # begin of OO interface
use HTTP::Date ();
use JSON ();
@@ -108,7 +109,7 @@ sub new {
my $fh;
unless ($opt->{pick}) { # pick files shall not block full run
- my $pidfile = "/var/run/mldistwatch.pid";
+ my $pidfile = File::Spec->catfile( $PAUSE::Config->{PID_DIR}, 'mldistwatch.pid');
if (open $fh, "+>>", $pidfile) {
if (flock $fh, LOCK_EX|LOCK_NB) {
truncate $fh, 0 or die;

0 comments on commit 9e0d81c

Please sign in to comment.
Something went wrong with that request. Please try again.