SQL/R startup/shutdown on Linux
@(#)$Revision: 4.2 $
--------------------------------------------------------------------

On the Linux platform, SQL/R preferably uses systemd to manage 
services for new installations. The systemd services provide 
similar functionality as the SQL/R SystemV start/stop scripts.


systemd
=======

The systemd unit files are installed in the /lib/systemd/system or
/usr/lib/systemd/system directory, depending on the distribution
conventions.

The systemd configuration is used to define the SQL/R services. 

The following systemd unit files are available:

sqlr40.target

   The SQL/R target encloses any enabled or running SQL/R services. 
   The target may be used to start or shut down all SQL/R services.

sqlr40.service

   The default SQL/R sqlrodbcd instance. Once enabled and started 
   a service name sqlr.service may be used as an alias.

sqlr40@.service

   Additional sqlrodbcd instances. The instance name must be 
   specified after the @ sign and implies the configuration file 
   name. For example, a sqlr40@test.service would use the 
   odbc-test.cfg configuration file.

The SQL/R services are not enabled by default. Please use 
"systemctl enable ..." to enable the necessary services for 
autostart.

   systemctl enable sqlr40.service

This enables the default sqlrodbcd instance.

To start or stop SQL/R services, the systemctl command is used:

   systemctl start sqlr40.target

   systemctl start sqlr40
   systemctl stop sqlr40
   systemctl status sqlr40

As system wide systemd services do require root capabilities sudo 
may be used to allow users to start/stop services without root 
capabilities.

If required for backwards compatibility the SQL/R SYSV init support 
may also used on systems which use systemd as an option. 
However, a manual installation is required.


SystemV init
============

The SystemV init scripts can be used on Linux with a SYSV style init
scheme. Since system startup and shutdown depends on the Linux 
distribution you may need to adapt these scripts to your specific 
requirements.

Currently, the following variations are supported:
- SUSE Linux
- RedHat Linux
- Debian (and derivates)
- LSB compatible

All startup/shutdown scripts variations use a common set of 
SQL/R specific functions, sourced from /opt/sqlr/4.0/etc/rcfunctions 
and add specific distribution specifc behavior, such as the location 
of the configuration file. 
The configuration file has a common format for all platforms.

Any corrections, enhancements or suggestions are appreciated.
Please mail any feedback to support@marxmeier.com


SuSE Linux
==========

The configuration file /etc/sysconfig/sqlr40 is used for startup
configuration. SQL/R uses /sbin/insserv to maintain run level links.


Red Hat Linux
=============

The configuration file /etc/sysconfig/sqlr40 is used for startup
configuration. SQL/R uses chkconfig to maintain run level links.


Debian (and derivates)
======================

The configuration file /etc/default/sqlr40 is used for startup
configuration. SQL/R uses update-rc.d to maintain run level links.


LSB compatible
==============

Unless there is specific support for a distribution, LSB compliance
is assumed if the file /lib/lsb/init-functions is present and 
/usr/lib/lsb/install_initd is executable (as required by the LSB).

Please refer to:
http://www.linuxbase.org/spec/gLSB/gLSB/sysinit.html

The SQL/R startup script is installed in /etc/init.d/sqlr40
and the run level links are maintained with the lsb
/usr/lib/lsb/install_initd utility.

/usr/lib/lsb/install_initd /opt/sqlr/4.0/newconfig/startup/lsb/sqlr40

By default, the SQL/R startup script is setup to start in
run levels 2 3 5 and stop in run levels 0 1 6.

The SQL/R startup configuration file is installed as
/etc/sysconfig/sqlr40


Other distributions
===================

You are basically on your own.
Please mail any feedback to support@marxmeier.com

A LSB compatible startup/shutdown script is included in the lsb 
subdirectory. It assumes the sqlr40.rc config file is installed in 
/etc/sysconfig/sqlr40.

Copy the configuration file sqlr40.rc to /etc/sysconfig/sqlr40
and the startup script lsb/sqlr40 to the appropriate location. 
Then edit the startup script as needed and create any startup links.
