From 45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 4 Nov 2010 07:41:35 +0000 Subject: use a sudo variable, like in other modules --- lib/Iurt/Process.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm index 0c4a271..7dc4898 100644 --- a/lib/Iurt/Process.pm +++ b/lib/Iurt/Process.pm @@ -18,6 +18,8 @@ our @EXPORT = qw( sudo ); +my $sudo = '/usr/bin/sudo'; + =head2 config_usage($program_name, $run) Check that there is no other program running and create a pidfile lock @@ -302,7 +304,7 @@ sub perform_command { sub clean_process { my ($run, $match, $verbose) = @_; - return clean($run, $match, "pgrep -u root -f", "sudo pkill -9 -u root -f", $verbose); + return clean($run, $match, "pgrep -u root -f", "$sudo pkill -9 -u root -f", $verbose); } sub clean { @@ -352,7 +354,7 @@ sub sudo { -x $config->{iurt_root_command} or die "FATAL: $config->{iurt_root_command} command not found"; - !system('/usr/bin/sudo', $config->{iurt_root_command}, @arg); + !system($sudo, $config->{iurt_root_command}, @arg); } 1 -- cgit v1.2.1