aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2010-11-04 07:41:35 +0000
committerOlivier Blin <blino@mageia.org>2010-11-04 07:41:35 +0000
commit45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7 (patch)
tree92e1065fb618ada7269ae0b61816d160d6fbd16e
parent2c03d4dc4aaff49dafb56ff38a474b199dc4a0b7 (diff)
downloadiurt-45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7.tar
iurt-45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7.tar.gz
iurt-45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7.tar.bz2
iurt-45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7.tar.xz
iurt-45be4cf2694eea4cdf24ffd0089b2d9d0c8048c7.zip
use a sudo variable, like in other modules
-rw-r--r--lib/Iurt/Process.pm6
1 files changed, 4 insertions, 2 deletions
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