602SQL Documentation Index  

602SQL Server Operation on Linux

The 602sql database server for Linux can be running in the foreground (communicating with an operator through console) or as a daemon in the background (accessible only from clients and also - in a limited way - by signals ).

For central startup and termination of 602SQL servers since version 11, serves a utility called Server Manager. We describe here only the control of servers without Server Manager that is also possible, or general principles of service registration etc.

The SQL server installation notes can be found here.

SQL server command line switches

SQL server accepts these command line switches:

If the -n switch is not specified, then:

The -p switch and the password have to be specified if the database is encrypted and protected by a password.

Running SQL server in the foreground

SQL server running in the foreground can be operated by keyword and displays new entries in the basic log on the screen. SQL server is run in the foreground mainly if it's desired to turn it on and off manually according to current needs.

Executing server in the foreground

SQL server is executed to run in the foreground from the console by the command:

602sqlXX -nserver_name
if there's only one server registered on the computer.

A server over a local database can be run from the 602SQL Client by the Start server command from the popup menu in the server list in the Control Panel. The Linux user has to have sufficient privileges for the database file.

Operating a server running in the foreground

A server running in the foreground responses on keystrokes; a list of acceptable keys and their meanings can be displayed after pressing the "h" key. The server is terminated by the "q" key.

Running SQL server as a daemon

SQL server is run as a daemon mainly if it's desired to start the server automatically after system startup.

If you need to watch the server log on the screen, use the tail -f <log file path> command.

Executing and terminating the server as a daemon

A SQL server is executed as a daemon, if the -d switch is specified in the command line. It's also recommended to specify the -P switch for displaying the process number. A server running as a daemon is terminated by sending the TERM signal and the kill <process number> command. You can also use the graphic interface for process control.

Another method is to use the /etc/init.d/s602sqlXX script file, that controls all servers registered in the /etc/602sql file with the AUTOSTART=1 flag. The command

/etc/init.d/s602sql11 start
executes all these servers in the background and saves their process numbers. The command
/etc/init.d/s602sql11 stop
then terminates these server. The
/etc/init.d/s602sql11 restart
can be used to restart these servers, and the command
/etc/init.d/s602sql11 status
displays each server's status Only the root user may execute these operations. Multiple server controlling doesn't affect the servers without the AUTOSTART flag or if this flag has an empty or zero value.

Another method for executing server automatically on system startup can be utilized on some Linux distributions. If a distribution allows to, then you can ensure the execution of "/etc/init.d/602sqlXX start" or "/etc/init.d/602sqlXX stop" on server startup or shutdown by the chkconfig s602sqlXX -add command.

This method is used on standard installation of the rpm package on SUSE and RedHat distributions and their successors.

Detecting daemon state

You can get the process list of running daemons by executing the ps program:

 ps u -C 602sqlXX --forest
for RedHat 8 Linux distributions use
 ps u -mC 602sqlXX --forest
There are at least 4 running processes for each running server; each tree in the displayed list corresponds to a single server.

Ports currently taken by running servers can be found using the netstat command, e.g.

netstat -npaA inet |grep 602sql

Privileges needed to start a server

A server is running on the user account that executed it, with only one exception to that: if the server is executed by the root user and the server description in the /etc/602sql file has this entry:
USER=<user name>
then the server runs on this user account.

The user whose account is running the server has to have read and write privileges to the database files (including logs) and to the database folder. Further he has to have the privilege to read and write to the /etc/602sql file and the privilege to create files in the /etc folder.

List of topics: