diff options
author | Marcelo Leitner <mrl@mandriva.com> | 2008-02-20 18:51:23 +0000 |
---|---|---|
committer | Marcelo Leitner <mrl@mandriva.com> | 2008-02-20 18:51:23 +0000 |
commit | b29b116f7d3f32a14257a4a55169d8ce11d71267 (patch) | |
tree | 0ccacde1ed66014942f53372dd5ad2b05f2d18db /lib | |
parent | 0d277bad9693d75f62032946aa6d7aa24956aaa5 (diff) | |
download | iurt-b29b116f7d3f32a14257a4a55169d8ce11d71267.tar iurt-b29b116f7d3f32a14257a4a55169d8ce11d71267.tar.gz iurt-b29b116f7d3f32a14257a4a55169d8ce11d71267.tar.bz2 iurt-b29b116f7d3f32a14257a4a55169d8ce11d71267.tar.xz iurt-b29b116f7d3f32a14257a4a55169d8ce11d71267.zip |
- Block two too dangerous pkill commands.
- Enhance logging for another pkill command.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Iurt/Process.pm | 1 | ||||
-rw-r--r-- | lib/Iurt/Urpmi.pm | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm index a15bbc4..9a9128f 100644 --- a/lib/Iurt/Process.pm +++ b/lib/Iurt/Process.pm @@ -315,6 +315,7 @@ sub clean { my $i; while ($ps = `$cmd "$var"`) { + plog('WARN', "Killing: $kill_cmd $var"); system(qq($kill_cmd "$var" &>/dev/null)); sleep 1; $ps =~ s/\n/,/g; diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 5d8fadc..99442dc 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -246,9 +246,10 @@ sub add_packages { sleep 30; $self->{wait_limit}++; if ($self->{wait_limit} > 10) { - $self->{wait_limit} = 0; - system(qq(sudo pkill -9 urpmi &>/dev/null)); - return; + #$self->{wait_limit} = 0; + # <mrl> We can't shoot such command, it's too powerfull. + #system(qq(sudo pkill -9 urpmi &>/dev/null)); + return 0; } 1; } },)) { @@ -373,8 +374,11 @@ sub wait_urpmi { plog("WARNING: urpmi database locked, waiting...") if $run->{debug}; sleep 30; $self->{wait_limit}++; - if ($self->{wait_limit} > 8) { - $self->{wait_limit} = 0; system(qq(sudo pkill -9 urpmi &>/dev/null)); + if ($self->{wait_limit} > 8) { + #$self->{wait_limit} = 0; + # <mrl> We can't shoot such command, it's too powerfull. + #system(qq(sudo pkill -9 urpmi &>/dev/null)); + return 0; } } |