Support

Stopping and Starting RStudio Package Manager

Follow

Stopping and Starting

Occasionally it is necessary to start and stop the RStudio Package Manager service. Stopping and starting is handled by systemd or Upstart.

The specific stop/start commands depend on the service daemon. Commands for systemd and Upstart are listed below.

After a restart, any scheduled syncs that were missed during downtime will automatically begin. See Section 14.4 of the admin guide for details.

systemd

Distributions using systemd include Red Hat/CentOS 7, SUSE 12, Ubuntu 16.04, and Ubuntu 18.04.

systemd is a management and configuration platform for Linux. The newest versions of most major Linux distributions have adopted systemd as their default init system.

The RStudio Package Manager installer installs a systemd service called rstudio-pm, which causes the RStudio Package Manager to be started and stopped automatically when the machine boots up and shuts down. The rstudio-pm service is also automatically launched during installation.

Use the following commands to manually start and stop the server:

sudo systemctl start rstudio-pm
sudo systemctl stop rstudio-pm

You can restart the server with:

sudo systemctl restart rstudio-pm

If you wish to keep the server running without interruption, but reload the configuration, you can use the systemctl command to send a HUP signal:

sudo systemctl kill -s HUP --kill-who=main rstudio-pm

The HUP signal causes the server to re-initialize but does not interrupt the current processes or any of the open connections to the server.

Use a HUP signal when your configuration changes are limited to properties marked as reloadable. See Appendix A in the admin guide to learn which settings may be reloaded via HUP. Perform a full restart of RStudio Package Manager when changing other properties.

You can check the status of the rstudio-pm service using:

sudo systemctl status rstudio-pm

And finally, you can use the enable/disable commands to control whether RStudio Package Manager should be run automatically at boot time:

sudo systemctl enable rstudio-pm
sudo systemctl disable rstudio-pm

Upstart (Ubuntu 14.04, Red Hat 6)

Distributions using Upstart include Red Hat/CentOS 6 and Ubuntu 14.04.

Upstart is a system used to automatically start, stop and manage services. The installer writes an Upstart configuration file to /etc/init/rstudio-pm.conf. This instructs the Upstart to initialize RStudio Package Manager as soon as the network is activated on the machine and stop when the machine is being shut down.

The Upstart configuration also ensures that the rstudio-pm process is respawned if the process unexpectedly terminates. However, in the event that there is an issue which consistently prevents RStudio Package Manager from being able to start (such as a bad configuration file), Upstart will give up on restarting the service after approximately 5 failed attempts within a few seconds. For this reason, you may see multiple repetitions of a bad RStudio Package Manager startup attempt before it transitions to the “stopped” state.

To start or stop the server, run the following commands, respectively.

sudo start rstudio-pm
sudo stop rstudio-pm

To restart the server you can run:

sudo stop rstudio-pm
sudo start rstudio-pm

The restart command re-initializes the server.

We recommend stop and start over restart because some configuration changes are not incorporated into a restart. In particular, restart does not re-read the Upstart definition at/etc/init/rstudio-pm.conf. Changes to this file need astopandstart` to take effect.

If you wish to reload the configuration and keep the server and all R processes running without interruption, you can use the reload command:

sudo reload rstudio-pm

This command causes the server to re-initialize but does not interrupt the current processes or any of the open connections to the server.

Use a HUP signal when your configuration changes are limited to properties marked as reloadable. See Appendix A in the admin guide to learn which settings may be reloaded via HUP. Perform a full restart of RStudio Package Manager when changing other properties.

To check the status or retrieve the process ID associated with rstudio-pm, run the following:

sudo status rstudio-pm

Comments