Directories and Files¶
Package Manager keeps nearly everything under its data directory, /var/lib/rstudio-pm/ (Server.DataDir).1 Posit documents few owners or modes, so this page gives the documented ones and marks the rest "Not documented".
How the files are laid out¶
The rstudio-pm account runs the service and every R and Python build process.3 Root owns the config in /etc/rstudio-pm/, and the service account writes to the data, socket, and log directories.
flowchart TD
PM(["rstudio-pm service"]) --> Etc("/etc/rstudio-pm/<br/>rstudio-pm.gcfg")
PM --> Data[("/var/lib/rstudio-pm/<br/>packages, db, git, key")]
PM --> Sock("/var/run/rstudio-pm/<br/>admin socket")
PM --> Tmp("Server.TempDir<br/>rspm-workspaces/")
PM --> Log("/var/log/rstudio/rstudio-pm/<br/>logs")
style PM fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
style Data fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
Paths, owners, and modes¶
The table lists each path with its documented owner and mode.
| Path | Owner | Mode | What it holds |
|---|---|---|---|
/etc/rstudio-pm/rstudio-pm.gcfg |
Not documented | Not documented | All settings.1 |
/etc/rstudio-pm/rstudio-pm.gcfg.defaults |
Not documented | Not documented | Example file with every default.1 |
/opt/rstudio-pm/bin/ |
Not documented | Not documented | rstudio-pm, rspm, and license-manager. |
/var/lib/rstudio-pm/ |
Not documented | Not documented | Server.DataDir: packages, caches, and state.1 |
{DataDir}/db |
Not documented | Not documented | Sqlite.Dir. Must be on a local filesystem, not NFS.1 |
{DataDir}/git |
Not documented | Not documented | Git.BuilderDir: repositories cloned by Git builders.1 |
{DataDir}/rstudio-pm.key |
Not documented | 0600 | Default for the deprecated Server.EncryptionKeyPath setting. The key is 64 bytes.1 |
{DataDir}/persistent/encryption/rstudio-pm.key |
Not documented | Not documented | Current key location, on [Storage].Persistent. Created at first start if missing.2 |
/var/lib/rstudio-pm/<license-file>.lic |
rstudio-pm | 0600 | License file. Any .lic here overrides other license methods.4 |
/var/run/rstudio-pm |
Not documented | Not documented | Server.SockFileDir: the admin socket rspm uses. systemd creates it at start (RuntimeDirectory=rstudio-pm), so do not add a tmpfiles.d entry.1 6 |
Server.TempDir (default $TMPDIR, then /tmp) |
Not documented | Writable by any user; typically 1777 | Scratch space. Must not sit under Server.DataDir.3 |
{TempDir}/rspm-workspaces |
Not documented | Not documented | One temporary folder per build process.3 |
/var/log/rstudio/rstudio-pm/rstudio-pm.access.log |
Not documented | Not documented | Server.AccessLog; an empty value turns it off.1 |
/var/log/rstudio/rstudio-pm/rstudio-pm-audit.log |
Not documented | Not documented | AuditLog.AuditLog, which also writes to STDOUT.1 |
/etc/systemd/system/rstudio-pm.service.d/user.conf |
Not documented | Not documented | Drop in that changes the service account. Keep it limited to User and Group.5 6 |
Back up the encryption key
Without the key, Package Manager cannot read the encrypted values in rstudio-pm.gcfg. Back it up with the data directory, and check which location your release uses.
Certificate and key¶
The TLS certificate and key are the one place Posit recommends an owner: keep them in /etc/rstudio-pm, owned by rstudio-pm:rstudio-pm.7 A key in /etc/ssl/private owned by root with mode 0600 or 0640 works when you run the binary by hand as root. Under systemd it fails, because the service runs as rstudio-pm.
See the crash loop case study for how this looks in the logs.
Changing the service account¶
To run the service as another account, follow Changing RunAs User. The new account must own every path the old one owned: the config file, logs, data directory, run directory, and Git workspace.5
Checking owners and modes¶
rpm -V lists files whose owner or mode changed since install, which catches a stray chmod. Run it with the other checks before and after a change.
sudo stat -c '%U:%G %a %n' /etc/rstudio-pm/rstudio-pm.gcfg /var/lib/rstudio-pm
sudo namei -l /var/lib/rstudio-pm
rpm -V rstudio-pm
Summary¶
The rstudio-pm account owns the data and the TLS key, and the documented private files are the encryption key and the license (both 0600). Server.TempDir must be writable by any user and sit outside the data directory. Before an upgrade, confirm where your release keeps the encryption key. The commands that change these files are on Sudo Commands.