This section explains how to control refdbd from the command line. The easy way is to use the provided control script that will be explained in the first subsection. If you need further control, you can use the command line of refdbd directly as explained in the second subsection.
The refdb package includes the refdbctl script which should be installed in /usr/local/bin. This is a simple shell script to start, stop, and reconfigure refdbd from the command line. The very same script is also used if you have instructed init(8) to start and stop refdbd.
Note: The refdbctl script is not intended for use on Windows systems.
refdbctl accepts the following arguments:
refdbctl start will try to start the daemon. refdbd will be called without any command-line parameters so all configuration parameters should be set in refdbdrc. The script prints a diagnostic message whether or not the daemon was successfully started. If the daemon is already running when you issue this command, the script will not try to start another process.
refdbctl stop will try to stop the daemon. This is done by sending the process the TERM signal. The script prints a diagnostic message whether or not the daemon was successfully stopped. For obvious reasons, if the daemon is not running when you issue this command, the script will not try to stop it.
refdbctl restart will cause the daemon to reload its configuration file by sending the process the HUP signal. The script prints a diagnostic message whether or not the daemon configuration was successfully reloaded. For obvious reasons, if the daemon is not running when you issue this command, the script will not try to restart it.
Calling refdbd directly allows you to specify configuration parameters on the command line. Start refdbd with the command:
refdbd [-b dbs-port] [-e log-destination] [-l log-level] [-L log-file] [-h] [-i IP-address] [-p port] [-P PID-file] [-q] [-r] [-s] [-T time] [-v] [-V]
The command-line switches are:
Set the port on which the database server listens for incoming connections. The default is 3306.
This specifies the destination of the log information. If destination is 0 or "stderr", the log output is sent to stderr. This should only be used for debugging purposes when refdbd is not run as a daemon.
If destination is 1 or "syslog", the syslog facility of the system is used. syslog has to be configured properly to accept refdb's log output. Consult the syslogd(8) man page how to achieve this.
If destination is 2 or "file", a custom log file as defined by the -L switch is used instead. If this log file cannot be written to, refdbd falls back to using syslog.
This switch specifies a custom log file (full path please). This will only be used if the -e switch is set accordingly.
Warning |
If you start refdbd as a user, you may not have write access to the default log file. In this case, use this option to specify a file that you can write to, e.g. $HOME/refdbd.log. |
Set the log level to a value between 0 and 7 or to a string value as described in log level definitions. 0 means that only critical log messages will be logged, while a value of 7 means that every log message will be logged. Set level to -1 to disable logging.
Caution |
Use log level 7 with caution and only for debugging purposes. Every SQL command and a plethora of other messages will be logged. This slows down the application server considerably and has the potential to grind your server to a halt by completely clogging the hard drive :-). |
Displays help and usage screen, then exits.
Set the IP address of the box which is running the database server (MySQL). Instead of the IP address you can also specify the hostname as long as it can be properly resolved by your system.
Set the port on which refdbd listens for incoming connections. The default is 9734.
Specify the full path of the file that refdbd writes its process ID to. This PID simplifies stopping and reconfiguring the application server from the command line. The default value is /var/log/refdbd.pid.
Warning |
If you start refdbd as a user, you may not have write access to the default PID file. In this case, use this option to specify a file that you can write to, e.g. $HOME/refdbd.pid. |
Start without reading the init file.
Enables remote administration via refdba.
Starts as a standalone application, not as daemon.
Set the timeout for client/application server dialogue in seconds.
Note: This option was previously a lowercase "-t" but has been changed to uppercase for the sake of consistency with the clients. The lowercase version still works in version 0.7.2 but will eventually be dropped.
Prints version and copyright information, then exits.
Switches to verbose mode.