Erik Shilts
Erik Shilts

Reputation: 4509

How do I setup a shared R package directory on a server?

I have a shared R package directory on a server in order to maintain consistent package versions for all users. This becomes problematic when someone attempts to install a new version of a package that another user originally installed, or they attempt to install it when that package is loaded elsewhere. In these instances R creates a 00LOCK-PackageName directory in the shared package directory, and the permissions are such that the installer doesn't have write access to many files within the directory. This then requires several people chmod-ind the directory to allow it to be deleted, or having one of our system administrators do the same.

This is an especially acute problem since we use R packages to maintain and deploy our reporting infrastructure. It's something that we're constantly updating and deploying to our shared server.

Are there settings or programs that facilitate shared R package management? Any general tips?

Upvotes: 6

Views: 507

Answers (2)

Erik Shilts
Erik Shilts

Reputation: 4509

We ended up having our systems administrator create a script that:

  • Opened permissions on all directories, subdirectories, and files within our shared package directory
  • Deleted any directories starting with 00LOCK that were older than 15 minutes
  • Ran every minute

We haven't run into any problems since.

Upvotes: 0

Dirk is no longer here
Dirk is no longer here

Reputation: 368231

One common solution is to

  • have everybody be a member of a common group, mayne rapps

  • have the directory where you share the R packages be group-owned by rapps, and you want to make that 'sticky' -- chmod g=rwt if I recall correctly

  • have your umask default set in /etc/profile or equivalent to make sure your default creation mode in in fact 'g+w'; I have used a file /etc/profile.d/local_umask.sh for this with a single command umask u=rwx,g=rwx,o=rx

Upvotes: 3

Related Questions