Search code examples
linuxubuntu-18.04gnu-parallel

Gnu parallel getting stuck, not giving output


Parallel seems to be installed properly as I am able to run basic parallel check commands.

# parallel --version
GNU parallel 20161222
Copyright (C) 2007,2008,2009,2010,2011,2012,2013,2014,2015,2016
Ole Tange and Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
GNU parallel comes with no warranty.

Web site: http://www.gnu.org/software/parallel

When using programs that use GNU Parallel to process data for publication
please cite as described in 'parallel --citation'.

But when I'm trying to execute a query on remote servers it doesn't give any output also doesn't returns the prompt.. eg :-

parallel ssh {} hostname :::: hosts
Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication
please cite:

  O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
  ;login: The USENIX Magazine, February 2011:42-47.

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

To silence this citation notice: run 'parallel --citation'.

in above eg , hosts file contains a list of remote server IP's

Even a simple parallel echo ::: A B C command doens's gives output..

I tried running with /usr/bin/parallel but issue remains..

when I ran the command using bash -x I get the following error :-

bash -x parallel ssh {} hostname :::: hosts
+ use IPC::Open3
/usr/bin/parallel: line 22: use: command not found
/usr/bin/parallel: parallel: line 24: syntax error near unexpected token `('
/usr/bin/parallel: parallel: line 24: `use POSIX qw(:sys_wait_h setsid ceil :errno_h);'

I've checked the file /usr/bin/parallel seems fine to me.

Not able to find solution for this. Any help is really appreciated. Thanks.

UPDATE_1 :-

root@sg-server:[~]:# parallel -Dall echo ::: 1
shell? perl /usr/bin/parallel -Dall echo ::: 1
shell? -bash
which -bash => shell path /bin/bash
Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication
please cite:

  O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
  ;login: The USENIX Magazine, February 2011:42-47.

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

To silence this citation notice: run 'parallel --citation'.

Open file descriptors: 2 1
echo Context:  Non: 4 Ctxgrp:  NonCtxGrp: 1
echo ▒<▒> Context:  Non: 4 Ctxgrp: 1 NonCtxGrp: 1
Wanted procs: 16
MultifileQueue->empty  RecordQueue->empty CommandLineQueue->empty JobQueue->empty  MultifileQueue->empty  RecordQueue->empty eval  1
noncontext + command: 5
context+noncontext + command: 5
cmd_line->number_of_args 1
Replace echo ▒<▒>
Target: echoTarget: ▒<▒>Replacing in ▒<▒>
Return echo 1
noncontext + command: 5
context+noncontext + command: 5
noncontext + command: 5
context+noncontext + command: 5
6 == 6 echo 1
Time to fork 1 procs: 0  (processes so far: 1)
MultifileQueue->empty 1 RecordQueue->empty 1CommandLineQueue->empty 1JobQueue->empty 1 RecordQueue-unget ''
JobQueue->empty  Limited to procs: 1
JobQueue->empty  Running jobs before on ::
: has  out of 1 jobs running. Start another.
JobQueue->empty  Command to run on ':': 'echo 1'
 processes . Starting (1): echo 1
bash -c testfun\(\)\ \{\ rm\ /tmp/parTMasE.tst\;\ \}\;\ export\ -f\ testfun\;\ perl\ -MIPC::Open3\ -e\ if\\\(\\\$pid\\\=::open3\\\(\\\$i,\\\$o,\\\$e,\\\"-\\\"\\\)\\\)\\\ \\\{\\\ wait\\\;\\\ \\\}\\\ else\\\ \\\{\\\ exec\\\(\\\"bash\\\",\\\"-c\\\",\\\"testfun\\\ \\\&\\\&\\\ true\\\"\\\)\\\;\\\ \\\} 2>/dev/null


^Ckill_sleep TERM
kill_sleep TERM
kill_sleep TERM
kill_sleep KILL

Even on running parallel -Dall echo ::: 1 command, I had to CTRL+c to get the prompt back.


Solution

  • As we debugged in the comments your (/usr/local)/bin/rm is not the normal (/usr/local)/bin/rm.