bug-parallel
[Top][All Lists]
Advanced

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

GNU Parallel Bug Reports parallel: existing file descriptors 3-61 are cl


From: Benjamin Moody
Subject: GNU Parallel Bug Reports parallel: existing file descriptors 3-61 are closed
Date: Mon, 16 May 2016 18:16:42 -0400

[I reported the following as Debian bug #816058 a couple months ago,
and haven't yet received a response from the maintainer.  The same
problem occurs with the current version, parallel-20160422.]

It seems that 'parallel' will (always?) automatically close all file
descriptors in the range 3 to 61 before starting the child process.

For example:

  $ exec 5</etc/passwd
  $ ls -l /dev/fd/
  total 0
  lrwx------ 1 benjamin benjamin 64 Feb 26 19:42 0 -> /dev/pts/2
  lrwx------ 1 benjamin benjamin 64 Feb 26 19:42 1 -> /dev/pts/2
  lrwx------ 1 benjamin benjamin 64 Feb 26 19:42 2 -> /dev/pts/2
  lr-x------ 1 benjamin benjamin 64 Feb 26 19:42 3 -> /proc/19896/fd
  lr-x------ 1 benjamin benjamin 64 Feb 26 19:42 5 -> /etc/passwd
  $ parallel ls -l <<</dev/fd/
  total 0
  lr-x------ 1 benjamin benjamin 64 Feb 26 19:42 0 -> pipe:[222723]
  lrwx------ 1 benjamin benjamin 64 Feb 26 19:42 1 ->
/tmp/L6a2EkkAKD.par (deleted)
  lrwx------ 1 benjamin benjamin 64 Feb 26 19:42 2 ->
/tmp/AEzA3WKNXP.par (deleted)
  lr-x------ 1 benjamin benjamin 64 Feb 26 19:42 3 -> /proc/19925/fd

This does not seem like a *useful* feature to me, and is in fact
making my life a bit difficult at the moment.  The only clue in the
source is the comment that "/dev/fd/62 and above are used by bash for
<(cmd)", but there's no explanation given as to why *those* file
descriptors should be treated differently from file descriptors opened
in other ways.  Moreover I don't see any mention of this in the
documentation.

Is there a reason for this behavior?

Benjamin



reply via email to

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