2.1. Installation as a Service on a Linux Server

For ad-hoc or temporary RCE network setups, running a headless RCE from the command line is perfectly fine. For more permanent installations, however, we recommend installing RCE as a Linux systemd Service instead. This has the advantage that RCE automatically shuts down when the server is shut down, and automatically restarts when the server does.

2.1.1. RCE as a Linux systemd Service

This section describes setting up RCE as an auto-start service on Linux.

Please note that the "rce-daemon" command provided with previous RCE releases for managing System V services is deprecated, and will most likely be removed in RCE 11.0.

Execute these steps to configure an RCE instance to run as a systemd service:

  • If not already present, install RCE using the .deb or .rpm package. (While installing a service from the plain .zip distribution is possible, the extra steps regarding file locations and permissions are not covered by this guide.)

  • Choose a command-line id for the instance; in the templates below, this is marked as <ID>. Ideally, it should only consist of ASCII letters and numbers to prevent command-line complications.

  • Choose a human-readable description for the instance; in the templates below, this is marked as <your_description>. Unlike the ID, this is much more flexible regarding allowed characters. This description is shown when listing services using systemd commands.

  • Choose a user and group to run the RCE instance under. Both the user and the group must already exist. In the template below, replace <User> and <Group> with the respective names (e.g. "user1") or numeric ids (e.g. "1000").

  • Choose a profile folder; in the template below, this is marked as <profile_folder_name>. In a standard file system layout, the instance's full profile path will be /home/<UID>/.rce/<profile_folder_name>. This folder does not need to exist, as RCE will create it automatically when that profile is first used (as long as the chosen user/group has sufficient permissions to do so).

  • Copy the template below into a file named rce-<ID>.service in /etc/systemd/system/. Note that on typical systems, you will need root/sudo permissions to create or edit this file.

  • By default, make sure this file's permissions are 0644 and ownership is root:root.

  • Replace all <placeholders> (description, UID/GID, and the profile folder) in that file.

  • Important: execute the command systemctl daemon-reload (as root or via sudo) after editing the service file to apply the changes.

  • In systemd terminology, the created .service file is called (or represents) a "service unit", which is then controlled through various standard commands. See the sect2 "Useful management commands" below for a list of commands. For now, just use systemctl start rce-<ID> to start the instance, and systemctl status rce-<ID> to see if it started as expected. If it did, use systemctl enable rce-<ID> to auto-start the service whenever the host machine is rebooted.

The .service unit file template

Lines ending with a backslash ("\") are only wrapped for layouting purposes; these can also be merged into single long lines.

[Unit]
	Description=<your_description (without quotes)>
	 
	After=network-online.target
	Wants=network-online.target
	 
	[Service]
	User=<User>
	Group=<Group>
	ExecStart=/usr/bin/rce -p <profile_folder_name> \
	  --headless --launcher.suppressErrors -nosplash
	ExecStop=/usr/bin/rce -p <profile_folder_name> \
	  --shutdown --launcher.suppressErrors -nosplash
	Type=simple
	 
	[Install]
	WantedBy=multi-user.target

Useful management commands

These commands must be either run as "root" or prefixed with "sudo".

  • systemctl start rce-<ID> - starts the service

  • systemctl stop rce-<ID> - stops the service

  • systemctl restart rce-<ID> - unsurprisingly, restarts the service

  • systemctl status rce-<ID> - display the service's status and its latest output

  • systemctl enable rce-<ID> - marks the service to auto-start after a reboot

  • systemctl disable rce-<ID> - disables auto-start after a reboot

  • systemctl list-units "rce-*" - lists all installed RCE services

2.1.2. Daemon Configuration

After installation, the daemon instance will be started automatically. This will create a default configuration file if it does not exist yet.

To configure the daemon instance, use rce-daemon locate to find its configuration file, edit and save it, and then use rce-daemon restart to apply the new configuration.

For importing SSH credentials and authorization group keys into a daemon, please refer to section "Importing authorization data without GUI access" in the User Guide. As of RCE 10, file-based imports are only processed on startup, so a restart is required for this, too.

Note

The need to restart the daemon is temporary; future versions of RCE will apply configuration changes as soon as configuration files are changed or new import files are placed in the respective folders.