parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Running perl code with parallel


From: Colin Close
Subject: Running perl code with parallel
Date: Wed, 15 Jun 2016 15:37:49 +0100
User-agent: KMail/5.2.1 (Linux/4.6.1-desktop-1omv; KDE/5.22.0; x86_64; ; )

Hi,
I have a bunch of perl code called urpmi; this code is basically a package 
manager written in perl. It uses rpm as it's engine.
I am trying to use parallel in place of xargs to pass this script a list of 
files to install into a chroot.

This is the command line that I am using:_
parallel -q  --halt now,fail=10 -P 1  /usr/sbin/urpmi --noclean --urpmi-root 
"$CHROOTNAME" --download-all --no-suggests --fastunsafe --ignoresize --nolock 
--debug ::: "$__install_list"
Running the command from within a bash script with --dry-run set generates the 
expected output however as soon as I remove the --dry-run flag the whole 
process hangs on the first invocation of /usr/sbin/urpmi.
I must either kill the bash script which is running parallel or kill the urpmi 
process to achieve an exit.
I have tried the following command line to try and obtain some debugging info:-
 parallel -q  --halt now,fail=10 -P 1  /usr/bin/perl \-d /usr/sbin/urpmi 
--noclean --urpmi-root "$CHROOTNAME" --download-all --no-suggests --fastunsafe 
--ignoresize --nolock --debug ::: "$__install_list"
What happens here is that the perl debugger is loaded but it is not possible to 
use any commands not even the first line of the program is loaded.

I have tried invoking the program (urpmi) via a bash function with the same 
result yet. I can execute the commands fine using xargs they also work fine 
from the command line and as individulal lines within the invoking bash script.
If, for example I took the output of --dry-run and accumulated it in a file and 
invoked it as a bash script it would work.

The irony of all this is that I did have this working on an earlier version of 
parallel and urpmi but with the later versions I cannot find a way to make it 
work.

Here I am not (at least at this time) taking advantage of parallelism but I 
wish to utilise the superior error control properties of parallel.

Where am I going wrong. 

Best,
Colin Close



reply via email to

[Prev in Thread] Current Thread [Next in Thread]