Directories and Files¶
A wrong owner or mode is a common reason Workbench fails to start, and the error rarely names the file. This page lists the directories and files Workbench uses, with the owner and mode where Posit documents them. "Not documented" means the guide gives no value; check those paths against a working server instead of guessing.
How the files are laid out¶
Workbench splits its files by job. Settings live in /etc/rstudio/, state in /var/lib/rstudio-server/, runtime files in /var/run/rstudio-server/, and logs in /var/log/rstudio/. Runtime files exist only while Workbench runs.
flowchart TD
WB(["rserver<br/>(rstudio-server user)"]) --> Etc("/etc/rstudio/<br/>settings")
WB --> Lib[("/var/lib/rstudio-server/<br/>database, audit, license")]
WB --> Run("/var/run/rstudio-server/<br/>runtime files")
WB --> Log("/var/log/rstudio/<br/>logs")
WB --> Home[("~/.local/share/rstudio/<br/>session state")]
style WB fill:#e8f1f8,stroke:#447099,stroke-width:2px,color:#1a1a1a
style Lib fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
style Home fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
The server process runs as rstudio-server, the default server-user.1 User sessions run as each signed in user, not as this account.
Configuration¶
What each file in /etc/rstudio/ does is on Configuration Files. Only one file there has a documented mode, and it is the one that can hold a password.
| Path | Owner | Mode | What it holds |
|---|---|---|---|
/etc/rstudio/database.conf |
root | 0600 | Internal database connection, possibly with a password. Workbench tries to set root:root 600 at start.3 |
/etc/rstudio/secure-cookie-key |
Not documented | Not documented | Cookie signing key, set by hand so every node in a cluster matches. A single node generates its own in /var/lib/rstudio-server/.4 |
Data, runtime, and logs¶
The service account owns the state under /var/lib/rstudio-server/. The license file there must stay private.
| Path | Owner | Mode | What it holds |
|---|---|---|---|
/var/lib/rstudio-server/ |
Not documented | Not documented | Default location of the internal SQLite database.3 |
/var/lib/rstudio-server/<license-file>.lic |
rstudio-server | 0600 | License file, not readable by other users.2 |
/var/lib/rstudio-server/audit |
Not documented | Not documented | audit-data-path: audit data.1 |
/var/lib/rstudio-server/monitor |
Not documented | Not documented | monitor-data-path: resource metrics.1 |
/var/lib/rstudio-server/shared-storage |
Not documented | Not documented | server-shared-storage-path: project sharing.1 |
/var/run/rstudio-server |
Not documented | Not documented | server-data-dir: runtime files.1 |
/var/run/rstudio-server.pid |
Not documented | Not documented | server-pid-file.1 |
/var/lib/rstudio-launcher/ |
Not documented | Not documented | Launcher state.5 |
/var/log/rstudio/rstudio-server/ |
Not documented | Not documented | Server logs.7 |
/var/log/rstudio/launcher/ |
Not documented | Not documented | Launcher logs.6 |
~/.local/share/rstudio/ |
Each user | Not documented | Per user session state.8 |
The last row matters for every user. A session writes to the user's home directory, so a home directory the user cannot write to breaks their sessions.
Checking owners and modes¶
Run the checks before and after a change, and save the output with the change record. namei -l shows every directory on a path, which finds the parent that blocks access.
sudo stat -c '%U:%G %a %n' /etc/rstudio/database.conf /var/lib/rstudio-server/*.lic
sudo namei -l /etc/rstudio/database.conf
Summary¶
Root owns the settings in /etc/rstudio/, the rstudio-server account owns the state, and each user owns their session files. Posit documents modes for only two files: database.conf and the license file (both 0600). Keep both private. The commands that change these files are on Sudo Commands.