Close menu

SQL/R systemd support

systemd is a framework to manage services in Linux. It was adopted by all contemporary Linux distributions and replaces the previous SystemV start/stop scripts to manage background services.

SQL/R on the Linux platform uses systemd to manage its services. As of version A.04.20 SQL/R no longer supports SystemV start/stop scripts as an option.

Each service type is defined by a unit file that describes the service and its dependency to systemd. The following systemd unit files are available with SQL/R:

sqlr42.service
The default SQL/R server instance.

sqlr42@.service
Additional SQL/R server instances. The instance name is specified after the @ sign and implies the SQL/R server configuration file name. For example, a service name sqlr42@test.service would use the odbc-test.cfg configuration file.

sqlr42.target
The sqlr42 target encloses any enabled or running SQL/R A.04.20 services. The target may be used to start or shut down all SQL/R A.04.20 services. This is relevant when more than a single sqlr instance is used.
The unit file names are versioned to allow coexistence with other SQL/R releases. Once enabled and started a service name without a version number may be used as an alias.

The SQL/R services are not enabled by default. The systemctl enable command is used to enable the services for autostart.

systemctl enable sqlr42
A .service extension is implied for service names and may typically be omitted.

The sqlr42@ instance must be enabled with an additional instance name. The instance name also defines the name of the associated configuration file.

systemctl enable sqlr42@test
The sqlr42@test.service describes an sqlrodbcd instance using the configuration file odbc-test.cfg.

The sqlr42.target may be used to specify any active or enabled SQL/R service.

# start/stop any configured SQL/R 4.2 services
systemctl start sqlr42.target
systemctl stop sqlr42.target

# list configured SQL/R 4.2 services and status
systemctl list-dependencies sqlr42.target

# list SQL/R 4.2 unit files and status
systemctl list-unit-files "sqlr42*"
The systemctl start command is used to start the enabled SQL/R services (requires root).
systemctl start sqlr42
- or -
systemctl start sqlr42.target
Changing system wide systemd services requires root permissions. Using sudo (with an appropriate sudoers entry) may be used to allow users to start/stop SQL/R services without unlimited root access.