Close menu

SQL/R A.03.00 Systemd support

systemd is a replacement framework for the System/V init scripts to manage services and is used by contemporary Linux distributions.

As of A.03.21, SQL/R on the Linux platform preferably uses systemd to manage services, where available. The systemd sqlr2.service unit file provides similar functionality to the SQL/R SystemV start/stop script.

When updating existing installations the previous System/V script is retained to maintain close compatibility. If the file /etc/init.d/sqlr2 is present during installation then systemd is not used.

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:

sqlr2.target
The sqlr target encloses any enabled or running SQL/R instances. The target may be used to start or shut down all SQL/R instances. [SQL/R A.03.32]

sqlr2.service
The default sqlrodbcd instance.

sqlr2@.service
Additional sqlrodbcd instances. The instance name is specified after the @ sign and implies the sqlrodbcd configuration file name. For example, a service name sqlr2@test.service would use the odbc-test.cfg configuration file. [SQL/R A.03.32]

SQL/R services is not enabled by default. The systemctl enable command is used to enable the services for start on system restart.

systemctl enable sqlr2.service
The sqlr2@ instances must be enabled with an additional instance name. The instance name also defines the name of the associated configuration file.
systemctl enable sqlr2@test.service

The sqlr2@test.service describes an sqlrodbcd instance using the configuration file odbc-test.cfg. The sqlr2.target may be used to specify any active or enabled SQL/R service.

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

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

# list SQL/R unit files and status
systemctl list-unit-files "sqlr2*"

The systemctl start command is used to start the enabled SQL/R services (requires root).

systemctl start sqlr2.target
- or -
systemctl start sqlr2.service

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 full root access.

Changes