Sudo Commands¶
Package Manager splits its commands in two. The service, the license, and the config file need sudo. The rspm CLI does not, provided you belong to the service account's group (default rstudio-pm).1 This page lists both.
flowchart TD
Task(["Package Manager task"]) --> What{"What changes?"}
What -->|"service, license,<br/>config file"| Sudo("sudo administrator")
What -->|"sources, repos,<br/>builders, credentials"| Group{"In rstudio-pm group?"}
Group -->|"yes"| You("Run rspm yourself")
Group -->|"no"| Add("sudo usermod -aG rstudio-pm #lt;user#gt;")
Add --> Relog("Sign in again")
Relog --> You
style Sudo fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
style You fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
Service and configuration¶
Package Manager reads rstudio-pm.gcfg at start. Settings that support SIGHUP can be refreshed with rspm hup instead of a restart.2
| Command | What it does |
|---|---|
sudo systemctl restart rstudio-pm |
Restarts Package Manager so it reads the config file. |
sudo systemctl status rstudio-pm |
Shows whether Package Manager runs. |
sudo usermod -aG rstudio-pm <user> |
Lets a user run rspm without sudo. They must sign in again.1 |
sudo setcap 'cap_net_bind_service=+ep' /opt/rstudio-pm/bin/rstudio-pm |
Lets the service bind port 443 or 80 without root.3 |
cat /proc/sys/user/max_user_namespaces |
Checks whether builds can run in a sandbox; above 0 means yes.4 |
Licensing¶
The license manager is a separate binary in /opt/rstudio-pm/bin/, and every example in the guide uses sudo.5
| Command | What it does |
|---|---|
sudo /opt/rstudio-pm/bin/license-manager status |
Shows the license state and expiry. |
sudo /opt/rstudio-pm/bin/license-manager activate <license-key> |
Activates a key online. |
sudo /opt/rstudio-pm/bin/license-manager deactivate |
Releases the key, before moving to a new server. |
sudo /opt/rstudio-pm/bin/license-manager --proxy=<url> activate <license-key> |
Activates through an HTTP proxy. |
sudo /opt/rstudio-pm/bin/license-manager status-offline |
Shows the offline license state. |
sudo /opt/rstudio-pm/bin/license-manager activate-offline-request <license-key> |
Writes a request file for an offline server. |
sudo /opt/rstudio-pm/bin/license-manager activate-offline <activation-file> |
Applies the activation file from Posit. |
sudo /opt/rstudio-pm/bin/license-manager deactivate-offline |
Writes an offline deactivation request. |
sudo /opt/rstudio-pm/bin/license-manager license-server <host:port> |
Points at a floating license server. clear-license-server undoes it. |
sudo cp -a <license-file>.lic /var/lib/rstudio-pm/ |
Installs a license file (owner rstudio-pm, mode 0600), then restart. A .lic file there overrides other methods. |
rspm commands¶
The table below lists the rspm commands an administrator uses most. Run them as rspm if you are in the group, or with sudo /opt/rstudio-pm/bin/rspm if not.6
| Command | What it does |
|---|---|
rspm list |
Lists sources and repositories. |
rspm create source, create repo, subscribe |
Builds the repository structure clients use. |
rspm create git-builder, edit git-builder, rerun |
Builds internal packages from Git. |
rspm import ssh-key |
Stores an SSH deploy key. |
rspm import https-credentials |
Stores an HTTPS token. |
rspm list git-builds, logs |
Shows build results and their logs. |
rspm sync |
Runs a sync now instead of on schedule. |
rspm offline, online |
Takes the service offline for maintenance, then back.7 |
rspm evict |
Clears cached files that download again on demand.8 |
rspm hup |
Refreshes settings that support SIGHUP.2 |
rspm encrypt |
Encrypts a value for the config file.9 |
rspm create token, revoke token, list tokens |
Manages API tokens. |
rspm create blocklist-rule, test blocklist-rules |
Blocks packages or versions. |
rspm cluster nodes, offline, online |
Manages nodes in a cluster. |
rspm config log |
Sets log levels. |
rspm bootstrap, login sso, verify |
Setup, sign in, and verification commands. |
rspm create metadata, list metadata |
Attaches metadata to packages. |
Sandboxed builds¶
Package Manager runs R and Python builds in a user namespace sandbox when it can, because building a package runs arbitrary code.4 Git.AllowUnsandboxedGitBuilds = true turns the sandbox off, and Posit calls that insecure. Turning the sandbox back on is a sudo change: raise user.max_user_namespaces above 0, set the option to false, and restart.
Summary¶
The service, the license, and the config file need sudo; rspm needs only group membership. Check the CLI reference for your release before you script an rspm command, because commands change between releases. The files these commands touch are on Directories and Files.