3

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.

akshay naidu
  • 115
  • 4
  • 18
  • All what you are doing is correct (except the `bash -x`: That is not supported). The only thing I can think if is if `/etc/parallel/config` contains something installed by your package manager. Try removing that. – Ole Tange Jan 18 '20 at 02:09
  • 1
    If that does not work try posting the output of: `parallel -Dall echo ::: 1`. It ought to help us figure out what is wrong. – Ole Tange Jan 18 '20 at 02:12
  • Thank you Mr. @OleTange for your time. I have updated my post with the output of `parallel -Dall echo ::: 1` . – akshay naidu Jan 20 '20 at 07:02
  • As for the content of **/etc/parallel/config** , There's nothing in /etc/parallel/ directory, checked by doing `ls -ltr /etc/parallel/` – akshay naidu Jan 20 '20 at 07:04
  • Your version of **GNU Parallel** is over 3 years old... can you update it? – Mark Setchell Jan 20 '20 at 08:32
  • Does this command complete in less than 0.1 second? (It is the last line of the output) `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` – Ole Tange Jan 20 '20 at 12:36
  • 1
    If it hangs, post the output of `strace -ff [same command as above]` – Ole Tange Jan 20 '20 at 12:56
  • @OleTange , The command didn't got completed, I waited for around 10 mins then cancelled with ctrl+c. Yes that's the last line of the output. It sort of hangs there. – akshay naidu Jan 20 '20 at 12:59
  • The output of `strace -ff parallel -Dall echo ::: 1` is 8000+ lines. Please view it in this [doc](https://docs.google.com/document/d/1thdIsS4ZkpJj6HySNPj6BLgs3HfkH8oE9cPOVUYAMSw/edit?usp=sharing). This command also didn't get completed, I had to Ctrl+c. – akshay naidu Jan 20 '20 at 13:26
  • 1
    What is the output of `strings /usr/local/bin/rm`? I think that command is not the normal `rm`, but that it asks `Your name:` and waits for input. That will explain why GNU Parallel is confused. – Ole Tange Jan 21 '20 at 12:33
  • Yes, that was the issue, someone from team with root access had changed `/bin/rm` to `/bin/infrarm` to protect files getting deleted from anyone accidentally. It's a blunder. I missed that in strace logs. I reverted the changes and now `parallel` is working perfectly fine. Thanks a ton for pointing that @OleTange . Huge fan of your parallel universe. – akshay naidu Jan 22 '20 at 06:25

1 Answers1

1

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

Ole Tange
  • 31,768
  • 5
  • 86
  • 104