On 04/23/14 23:22, William Dunlap wrote:
Aren't those files support for named semaphores (made with sem_open())?
Packages like BH and RSQLite contain calls to sem_open.   Is your long-running
R process using such a package?

I don't think you would want to delete those files, but perhaps you can look 
into
whatever R package creates them and see if you can modify the code to give
them better names and then add those names to rkhunter's whitelist.

You don't seem to understand what I'm asking. I have zero intention of deleting those files. I'm sure that my user's long-running job is creating them. What I'm asking is if ANYONE HERE knows if there is some configuration file, or command inside R, that would tell R, whatever package it's using (I assume that all packages inherit from the top-level process), when it creates files in /dev/shm, to name them something that I can use with wildcards in rkhunter's configuration file so that rkhunter ignores them.

        mark


-----Original Message-----
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf
Of Jim Lemon
Sent: Wednesday, April 23, 2014 2:18 PM
To: m.r...@5-cent.us
Cc: r-help@r-project.org
Subject: Re: [R] meta-question about R

On 04/23/2014 11:58 PM, m.r...@5-cent.us wrote:
This really isn't about R, but configuring R. We're running R 3.0.2-1, the
current default package, on CentOS 6.5 On a long-running job, R is
creating files in /dev/shm: each set of three files are named (8 hex
digits)-(4 hex digits)-(4 hex digits)-(4 hex digits)-(12 hex digits), and
then sem.(same as the name)_counter_mutex, and (same as the name)_counter.

For example,
156d23b0-9e67-46e2-afab-14a648252890
156d23b0-9e67-46e2-afab-14a648252890_counter
sem.156d23b0-9e67-46e2-afab-14a648252890_counter_mutex

Is there some way to configure R to add a prefix, say, to each of these
files? We're running rkhunter (rootkit hunter) for security, and it
complains about suspicious files, and I'd like some way to be able to tell
it to, say, ignore R_temp.whatever....

Hi mark,
I assume that the problem is to identify the files in /dev/shm, not to
simply change your R code to tack the prefix onto the files as it
produces them. As your hexadecimal digits are probably randomly
generated, the solution may be to identify all the files that have
"_counter_mutex" in the name, then chip off the appropriate bits to get
the troublesome first name.

filenames<-list.files(pattern="_counter_mutex")
# function to return the two other filenames
strip_fn<-function(x) {
   f2<-substr(x,5,nchar(x)-6)
   f1<-substr(f2,1,nchar(f2)-8)
   return(c(f1,f2))
}
# get all the filenames
filenames<-c(filenames,unlist(sapply(filenames,strip_fn)))
# stick on the prefix
newfilenames<-paste("R_temp",filenames,sep=".")
# create the commands
fnmove<-paste("mv",filenames,newfilenames)
# move the filenames
for(fn in 1:length(fnmove)) system(fnmove[fn])

Warning - I haven't tested the last bit of this, but it should work.
There is probably some really neat string of heiroglyphs in a regular
expression that will do this as well.

Jim

______________________________________________
R-help@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.


______________________________________________
R-help@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.

Reply via email to