Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

full ubic-watchdog path to the crontab on setup

  • Loading branch information...
commit 44f4d19ddcbacd5a418f8b078e043d1e92bf0dfb 1 parent df3a02a
@berekuk authored
Showing with 5 additions and 1 deletion.
  1. +1 −0  Changes
  2. +3 −1 lib/Ubic/Admin/Setup.pm
  3. +1 −0  t/setup.t
View
1  Changes
@@ -1,6 +1,7 @@
Revision history for Ubic
{{$NEXT}}
+ * detect ubic-watchdog location and put its full path to the crontab on setup
1.47 2012-12-03
* compatibility with perl 5.17 hash randomization
View
4 lib/Ubic/Admin/Setup.pm
@@ -23,6 +23,7 @@ use Getopt::Long 2.33;
use Carp;
use IPC::Open3;
use File::Path;
+use File::Which;
use Ubic::AtomicFile;
use Ubic::Settings;
@@ -322,6 +323,7 @@ sub setup {
}
my $crontab_env_fix = '';
+ my $ubic_watchdog_full_name = which('ubic-watchdog') or die "ubic-watchdog script not found in your current PATH";
{
my @path = split /:/, $ENV{PATH};
my @perls = grep { -x $_ } map { "$_/perl" } @path;
@@ -435,7 +437,7 @@ sub setup {
print {$fh} @_ or die "Can't write to pipe: $!";
};
$printc->($old_crontab."\n");
- $printc->("* * * * * ${crontab_env_fix}ubic-watchdog ubic.watchdog >>$log_dir/watchdog.log 2>>$log_dir/watchdog.err.log\n");
+ $printc->("* * * * * $crontab_env_fix$ubic_watchdog_full_name ubic.watchdog >>$log_dir/watchdog.log 2>>$log_dir/watchdog.err.log\n");
close $fh or die "Can't close pipe: $!";
}
}
View
1  t/setup.t
@@ -15,6 +15,7 @@ my $perl = $Config{perlpath};
local $ENV{ORIGINAL_HOME} = $ENV{HOME};
local $ENV{HOME} = 'tfiles';
+local $ENV{PATH} = "bin:$ENV{PATH}";
xsystem("$perl ./bin/ubic-admin setup --batch-mode --no-install-services --no-crontab --local --reconfigure");
Please sign in to comment.
Something went wrong with that request. Please try again.