Skip to content

ubuntu configuration problem "Couldnt get a file descriptior referring to the console"

3 messages · Dirk Eddelbuettel, Paul Johnson

#
Greetings to everybody in r-sig-debian land.

I hope I have found the right place to ask this. If not, please refer me on...

I run R 2.9 on Ubuntu 9.04.   I believe many people have seen this
problem, but because the error message is hard to understand, they
have not traced it back to the R install in the distribution.  I think
it ought to be fixed in the R packaging process, but I do not know if
the problem begins with the Debian packaging or if someone at Ubuntu
has caused it.

As far as I can see, any program that tries to spawn a pdf viewer
fails with this somewhat uninformative error message:
I've traced this back to  a setting in /etc/R/Renviron:

## Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-'/bin/open'}

That setting causes the trouble--if it is changed to a valid pdf
viewer, then the strange error message does not appear.  If your
system has the OpenDesktop mime system in place, this setting will
work:

# Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xdg-open'}

I've also learned that within a session a pdf viewer can be set with options:

options(pdfviewer = "evince")

Why does the existing configuration refer to /bin/open?  Can this be
fixed by the packager so that users don't have to make this change?


Here is the post that says this is a debian-sig issue:
http://www.nabble.com/Re:-unable-to-view-vignette-in-R-p20522903.html
And I believe this problem has existed for a long time because:
https://stat.ethz.ch/pipermail/r-help/2007-September/141178.html
PJ
#
Paul,
On 15 June 2009 at 08:49, Paul Johnson wrote:
| Greetings to everybody in r-sig-debian land.
| 
| I hope I have found the right place to ask this. If not, please refer me on...

No this is the right place. So welcome!
 
| I run R 2.9 on Ubuntu 9.04.  

That was 'a little underspecified'. "Whose R"? I.e. where did the binary come
from?  CRAN? Or from sources and you built it yourself?  What is the
architecture?

[ Ok, I figured it out comparing amd64 (at work) to i386 (at home). My
R-on-Ubuntu at home has the same problem. ]

| I believe many people have seen this
| problem, but because the error message is hard to understand, they
| have not traced it back to the R install in the distribution.  I think
| it ought to be fixed in the R packaging process, but I do not know if
| the problem begins with the Debian packaging or if someone at Ubuntu
| has caused it.
| 
| As far as I can see, any program that tries to spawn a pdf viewer
| fails with this somewhat uninformative error message:
| 
| > RShowDoc("frame", package="grid")
| > Couldnt get a file descriptor referring to the console
| 
| I've traced this back to  a setting in /etc/R/Renviron:
| 
| ## Default PDF viewer
| R_PDFVIEWER=${R_PDFVIEWER-'/bin/open'}

On my Ubuntu system at work (amd64, 2.9.0 binaries from CRAN using Vicent and
Michael's "Ubuntu re-builds" of my Debian packages) I have

$ grep -i pdf /etc/R/Renviron
R_PDFLATEXCMD=${R_PDFLATEXCMD-${PDFLATEX-'/usr/bin/pdflatex'}}
R_RD4PDF=${R_RD4PDF-'times,hyper'}
## Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xpdf'}
$

The '/usr/bin/xpdf' is actually an explicit setting, and we ensure xpdf is
present at built time.

On my Ubuntu system at home (i386, binaries from CRAN as well) I have the
same problem you diagnosed.  Now, I don;t use that machine much for R so I
never noticed...

This seems to be a genuine bug in the i386 CRAN builds, and I trust Vincent
and Michael will try to fix it.

| That setting causes the trouble--if it is changed to a valid pdf
| viewer, then the strange error message does not appear.  If your
| system has the OpenDesktop mime system in place, this setting will
| work:
| 
| # Default PDF viewer
| R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xdg-open'}
| 
| I've also learned that within a session a pdf viewer can be set with options:
| 
| options(pdfviewer = "evince")

See help(Startup) -- you can also make that 'permanent' via the files in
either $(HOME) or below /etc/R/.

| Why does the existing configuration refer to /bin/open?  Can this be
| fixed by the packager so that users don't have to make this change?

We sure should try to fix it, esp as it comes from a pre-packaged binary.

Thanks,  Dirk


 
| Here is the post that says this is a debian-sig issue:
| http://www.nabble.com/Re:-unable-to-view-vignette-in-R-p20522903.html
| And I believe this problem has existed for a long time because:
| https://stat.ethz.ch/pipermail/r-help/2007-September/141178.html
| PJ
| 
| -- 
| Paul E. Johnson
| Professor, Political Science
| 1541 Lilac Lane, Room 504
| University of Kansas
| 
| _______________________________________________
| R-SIG-Debian mailing list
| R-SIG-Debian at r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-debian
#
On Mon, Jun 15, 2009 at 9:18 AM, Dirk Eddelbuettel<edd at debian.org> wrote:
Ah, I'm using the ubuntu package from CRAN, I think. I download it
from the Iowa state mirror:

deb http://rh-mirror.linux.iastate.edu/CRAN/bin/linux/ubuntu jaunty/ #iastate R
I've downloaded the R source code and I see where the problem
originates.  I think the DEB packages for ubuntu must be built on a
system that does not have any of the expected pdf viewers.  If you
look in the R configure script, it sets a macro variable for the
viewer

## PDF viewer
for ac_prog in ${R_PDFVIEWER} acroread acroread4 evince xpdf gv
gnome-gv ggv kghostview open gpdf

When I buld R on my system, it finds acroread and that gets put into
the /etc/R/Renviron file for the  PDFVIEWER.

On the system where R is built for CRAN, it must not find acroread,
evince, or anything until "open".

I *THINK* it might be slightly more "in style" to make the preferred
pdf viewer xdg-open.  I've had some ups and downs with xdg-open
because it is poorly documented (that's another trauma discussed
elsewhere).  But, if you are going by the Ubuntu community standard,
xdg-open should be first.

pj