[R] Fw: Difficulty with saving .Rhistory

T blackswanmabak at yahoo.com
Wed Sep 14 23:05:53 CEST 2011



HTH,

Hahaha, not sure why but I must have filled out T, but I thought that I filled the name out as Tommy...it truncated somewhere.  TC... "Theodore Calvin" the chopper pilot from Vietnam on Magnum PI?   ;-)  Nope, not me.



Sorry all!  I fixed it.  It was that the group was also not root.  I've included the notes in case anyone else runs in to this issue.


What I will do is to try and communicate with the SE LInux guys to see if there is anything that needs to be done to tighten it up using SE Linux security policies.  I am going to have to reinstall in any case since I gave the resource g+w on all the directories in the filesystem so that it could write to the directories.  MY BAD!  Hahaha...


NOTE!

[root at localhost ~]# find /root | grep \.*[Rr][Hh]
/root/.Rhistory

[Object at localhost ~]$ su -
Password:
[root at localhost ~]# chown -R root:root /var/R/R-2.13.1


[root at localhost ~]# ls -al /var/R
total 21604
drwxr-xr-x  3 root root     4096 Sep  9 19:02 .
drwxr-xr-x 28 root root     4096 Sep  9 18:57 ..
drwxrwxr-x 15 root root     4096 Sep  9 19:05 R-2.13.1
-rw-r--r--  1 root root 22063747 Sep  9 18:58 R-2.13.1.tar.gz
[root at localhost ~]# ls -al /var/R/R-2.13.1
total 3772
drwxrwxr-x 15 root root    4096 Sep  9 19:05 .
drwxr-xr-x  3 root root    4096 Sep  9 19:02 ..
drwxrwxr-x  3 root root    4096 Sep  9 19:05 bin
-rw-r--r--  1 root root       0 Mar 17  2010 ChangeLog
-rw-r--r--  1 root root  356442 Sep  9 19:04 config.log
-rw-r--r--  1 root root    9277 Mar 29 17:02 config.site
-rwxr-xr-x  1 root root  110293 Sep  9 19:03 config.status
-rwxr-xr-x  1 root root 1350078 Jun 30 17:05 configure
-rw-r--r--  1 root root   83993 May 30 17:05 configure.ac
-rw-r--r--  1 root root   18011 Mar 17  2010 COPYING
drwxrwxr-x  4 root root    4096 Sep  9 19:06 doc
drwxrwxr-x  2 root root    4096 Sep  9 19:03 etc
drwxrwxr-x  3 root root    4096 Sep  9 19:03 include
-rw-r--r--  1 root root    1747 Mar 17  2010 INSTALL
drwxrwxr-x  3 root root    4096 Sep  9 22:29 lib
...


[Object at localhost ~]$ R

R version 2.13.1 (2011-07-08)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> q()
Save workspace image? [y/n/c]: y
[Object at localhost ~]$





----- Original Message -----
Sent: Wednesday, September 14, 2011 2:34 AM
Subject: Re: [R] Difficulty with saving .Rhistory

Hello T (short for TC, no doubt),


It appears to me that you're trying to run as a user in the /root/
directory.  Move to a directory down from /home/ and I think you'll
find it works.  

If my guess is incorrect, perhaps if you provide a long list of the
working directory and we'll see what's going on with the permissions.


HTH


On Tue, 13-Sep-2011 at 09:55PM -0700, T wrote:

|> 
|> Current systems
|> 
|>     OS: RedHat SE Linux 5.7, fully patched
|>     R: R-2.13.1
|> 
|> 
|> I am a new R user.
|> 
|> 
|> The R installation needs to be very tight because I plan to use it after I am employed on Internet facing systems to analyse firewall and filesystem log data.  Everything to my knowledge regarding R installed correctly.  I saw no warnings until saving THE WORKSPACE.
|> 
|> 
|> NON-ROOT OUTPUT CURRENTLY YIELDS THE FOLLOWING ERROR
|> > q()
|> Save workspace image? [y/n/c]: y
|> Warning message:
|> problem in saving the history file '.Rhistory'
|> [Object at localhost R]$
|> 
|> 
|> 
|> The sitrep...
|> 
|> 
|> ------------------------------------------------------------------------------
|> INITIAL NON-ROOT OUTPUT WAS THE FOLLOWING
|> > q()
|> Save workspace image? [y/n/c]: y
|> Error in gzfile(file, "wb") : cannot open the connection
|> In addition: Warning message:
|> In gzfile(file, "wb") :
|>   cannot open compressed file '.RDataTmp', probable reason 'Permission denied'
|> >
|> > q()
|> Save workspace image? [y/n/c]: n
|> Warning message:
|> In file.remove(outfile) :
|>   cannot remove file '.RDataTmp', reason 'No such file or directory'
|> 
|> 
|> INITIAL ROOT WAS THE FOLLOWING:
|> >
|> > q()
|> Save workspace image? [y/n/c]: y
|> [root at localhost ~]#
|> 
|> 
|> Here is what I did, which I thought would fix everything:
|> 
|> [root at localhost ~]# groupadd -g 666 r_users
|> [root at localhost ~]# usermod --groups r_users Object
|> [root at localhost ~]# cat /etc/group | grep r_users
|> r_users:x:666:Object
|> 
|> [root at localhost ~]# chown -R root:r_users /var/R/R-2.13.1
|> [root at localhost ~]# 
|> [root at localhost ~]# find /var/R/R-2.13.1 -type d | xargs chmod g+rwx
|> 
|> 
|> 
|> 
|> Note that I have gREpped for the .RDataTmp file and any variation between "R[Dd]ata" and I see nothing being written but the warnings have stopped...so maybe I am not generating anything to save the workspace.
|> 
|> 
|> Now, when using a non-root account I have an issue with the .Rhistory file in that I have the following warnings.
|> 
|> ROOT NOW YIELDS THE FOLLOWING:
|> > q()
|> Save workspace image? [y/n/c]: y
|> [root at localhost ~]#
|> 
|> 
|> NON-ROOT OUTPUT NOW YIELDS ANOTHER ERROR
|> > q()
|> Save workspace image? [y/n/c]: y
|> Warning message:
|> problem in saving the history file '.Rhistory'
|> [Object at localhost R]$
|> 
|> 
|> [Object at localhost R]$ ls -al /var/R/
|> total 21604
|> drwxr-xr-x  3 root root        4096 Sep  9 19:02 .
|> drwxr-xr-x 28 root root        4096 Sep  9 18:57 ..
|> drwxrwxr-x 15 root r_users     4096 Sep  9 19:05 R-2.13.1
|> -rw-r--r--  1 root root    22063747 Sep  9 18:58 R-2.13.1.tar.gz
|> 
|> [Object at localhost R]$ ls -al /var/R/R-2.13.1
|> total 3772
|> drwxrwxr-x 15 root r_users    4096 Sep  9 19:05 .
|> drwxr-xr-x  3 root root       4096 Sep  9 19:02 ..
|> drwxrwxr-x  3 root r_users    4096 Sep  9 19:05 bin
|> -rw-r--r--  1 root r_users       0 Mar 17  2010 ChangeLog
|> -rw-r--r--  1 root r_users  356442 Sep  9 19:04 config.log
|> -rw-r--r--  1 root r_users    9277 Mar 29 17:02 config.site
|> -rwxr-xr-x  1 root r_users  110293 Sep  9 19:03 config.status
|> -rwxr-xr-x  1 root r_users 1350078 Jun 30 17:05 configure
|> -rw-r--r--  1 root r_users   83993 May 30 17:05 configure.ac
|> -rw-r--r--  1 root r_users   18011 Mar 17  2010 COPYING
|> drwxrwxr-x  4 root r_users    4096 Sep  9 19:06 doc
|> drwxrwxr-x  2 root r_users    4096 Sep  9 19:03 etc
|> drwxrwxr-x  3 root r_users    4096 Sep  9 19:03 include
|> -rw-r--r--  1 root r_users    1747 Mar 17  2010 INSTALL
|> drwxrwxr-x  3 root r_users    4096 Sep  9 22:29 lib
|> ...
|> 
|> ______________________________________________
|> R-help at r-project.org mailing list
|> https://stat.ethz.ch/mailman/listinfo/r-help
|> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
|> and provide commented, minimal, self-contained, reproducible code.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.  
   ___    Patrick Connolly  
{~._.~}                   Great minds discuss ideas    
_( Y )_               Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
(_)-(_)                            ..... Eleanor Roosevelt
      
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the R-help mailing list