Skip to content

Commit 1701f12

Browse files
author
oiami
committed
Merge branch 'master' into improve_no_result_page
2 parents dc9f7e2 + a324ba8 commit 1701f12

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

bin/daemon-control.pl

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,21 @@
66
use warnings;
77

88
use Daemon::Control;
9-
use Sys::Hostname qw( hostname );
10-
11-
my $name = 'metacpan-www';
12-
my $user = 'metacpan';
13-
my $home = '/home/metacpan/metacpan.org';
9+
use File::Path 2.06 (); # core
10+
11+
my $name = 'metacpan-www';
12+
my $user = 'metacpan';
13+
my $root = '/home/metacpan';
14+
my $home = "$root/metacpan.org";
15+
my %dirs = (
16+
pid => "$home/var/run",
17+
log => "$home/var/log",
18+
);
1419
my $carton = '/usr/local/perlbrew/perls/perl-5.16.2/bin/carton';
1520
my $workers = 7;
1621

17-
if ( hostname() eq 'debian' ) {
22+
# If running in the development vm change the user to avoid permission problems.
23+
if ( -d '/vagrant' ) {
1824
$user = 'vagrant';
1925
$workers = 3;
2026
}
@@ -29,6 +35,8 @@
2935
'-s', => 'Starman',
3036
);
3137

38+
File::Path::make_path( values %dirs );
39+
3240
# Notes on unused args
3341
# scan_name: seems to be just 'starman master' (not useful)
3442
# stdout_file: always seems to be just empty
@@ -37,15 +45,15 @@
3745
directory => $home,
3846
fork => 2,
3947
group => $user,
40-
init_config => "$home/.metacpanrc",
48+
init_config => "$root/.metacpanrc",
4149
lsb_desc => "Starts $name",
4250
lsb_sdesc => "Starts $name",
4351
name => $name,
4452
path => "$home/bin/daemon-control.pl",
45-
pid_file => "$home/var/run/$name.pid",
53+
pid_file => "$dirs{pid}/$name.pid",
4654
program => $carton,
4755
program_args => \@program_args,
48-
stderr_file => "$home/var/logs/starman_error.log",
56+
stderr_file => "$dirs{log}/starman_error.log",
4957
user => $user,
5058
};
5159

git/hooks/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
use strict;
44
use warnings;
5+
# Hack to use carton's local::lib.
6+
use lib 'local/lib/perl5';
57

68
use Code::TidyAll::Git::Precommit;
79
Code::TidyAll::Git::Precommit->check();

0 commit comments

Comments
 (0)