Daylight v4.9
Release Date: 1 February 2008


merlinserver - database network server

Unix Synopsis

merlinserver [option arg]... [database ...]


merlinserver provides a database-access service for Merlin client applications programs; its capabilities include high-speed database searches of THOR databases using in-memory techniques.

The Merlin server normally runs as "background", or "daemon" programs, and have no direct user interfaces. See the Daylight Theory Manual for more information.

If one or more databases are specified on the command line, they are opened and marked "hold" (see dt_hold(3), thorchange(1), sthorman(1)). For Merlin, this means the database is loaded into memory and marked "hold" for immediate use by clients.


Limits the maximum number of client programs that can simultaneously connect to the Merlin server, respectively, to n, where n is an integer. The default is 64. Note that this value is superseded by the maximum number of clients allowed by your license if the licensed value is less.
Changes the name of the TCP/IP service that the servers use (see /etc/services). The defaults is "merlin". Note that service must appear in your license file on the "servers:" line or the license manager will print an error and kill the server. Only services that begin with the characters "merlin" are allowed (e.g. "merlin2" and "merlin_manager" are allowed for merlinserver but "mer2" is not).
Use file as the passwords file to secure against unauthorized connections to the server. The default is:


merlinserver must have read/write access to the file and the directory in which the file resides. If file is an empty string, the server is started with no security; connections will be accepted from all clients (but limited by MERLIN_MAX_CLIENTS and the license). In this case, only the database passwords protect your data against unauthorized access.

-DATABASE_PATH "directory [directory...]"
Specifies a set of paths that are to be searched when a database is being opened. The default is $DY_THORDB. Proper use of this option allows users (client programs such as xvmerlin(1)) to open databases without entering the whole path to the database. For example, if the directory /usr/local/thordb is included in the set of directories, the database /usr/local/thordb/pomona92c could be opened by simply using the name "pomona92c". The directories are searched in the order specified; if a particular database name appears twice, the one that occurs earlier in the list of directories will be used. Note that if more than one directory is specified, all directories must be placed inside of one pair of quotes, separated by spaces.
(Merlin server only.) "limit" specifies the maximum number of bytes of memory the Merlin server is allowed to use. This limit is approximate, and may be slightly exceeded. It is almost always a good idea to limit the amount of memory the Merlin server can use, in case of "accidentally" loading too many databases. On some operating systems (e.g. SunOS, HPUX), the Merlin server can use all available memory, making it impossible to start any other process. On other systems (e.g. SGI IRIX), the system will mercilessly kill the Merlin server if it tries to use all available memory.
(Merlin server only.) Specifies the number of CPUs to use for searching. If you have a multi-CPU machine, you can improve some search times dramatically by specifying a non-zero number for this option. To get the fastest searches, specify the number of CPUs you have (e.g. on a 4-CPU machine, specify 4 for this option). Specifying more processes than CPUs doesn't speed the search any more. If you want to leave some CPUs for other processes, specify fewer. A value of zero causes Merlin to revert to internal functions for searching; single-CPU machines should use zero. (Note: in the 4.42 release, only superstructure searching is parallelized.)
(Merlin server only.) Specifies the path to the "merlinsmartstalk" program used to parallelize SMARTS searches. This option is "factory set" -- you should never have to change it.
merlin/pool/-MERLIN_PROGRAM_OBJECTS progob [|progob ...]
(Merlin server only.) Specifies program objects that are to be run by the merlinserver. Parameters to the program can be specified in the option (e.g. "merlinbintalk -e"), and multiple program objects can be separated with a vertical-bar character (e.g. "merlinbintalk -e|merlinbintalk -t"). See options MERLIN_PROGOB_DIR and MERLIN_PROGOB_PERMISSION, below.
(Merlin server only.) Specifies the directory in which user-written program objects are found. Only executable programs in a directory explicitly named in this option can be executed as program objects. Furthermore, the directories specified here must be owned by the same user who starts the merlinserver, and must not be writable by anyone else (unless the 'permission', which is the value from option MERLIN_PROGOB_PERMISSION, allows less restrictive write permission). If a directory doesn't meet these conditions, it is ignored, and programs in it can't be executed. These restrictions are necessary because programs executed by merlinserver run as the same userid as the person as the merlinserver, and thus usually have full access (i.e. both read and write) to the THOR database files.
(Merlin server only.) Specifies required ownership of files in the program-object directory (see MERLIN_PROGOB_DIR, above). A value of "OWNER" means all program object in the directory and the directory itself must be writable only by the owner. "GROUP" means the programs and directory can be writable by the owner and group. "OTHER" means the programs and directory can be writable by anyone. It can be VERY dangerous to set this option to "OTHER", as it essentially removes all security from the THOR/Merlin system.
(Merlin server only.) As Merlin is loading a database, it prints progress information in its log file. The "major report" is a summary of the number of TDTs loaded so far and the number of errors encountered. The "minor report" is simple a dot ("."). These two options control how often these reports are printed; the numbers indicate how many TDTs are to be read from the database between reports. The default minor and major reports are 100 and 5000, respectively.
The Merlin server's log files keep auditing information, such as user logins, database creation and modification, and other "executive" operations. Default is "" (standard output).

Return Value

The Merlin server normally doesn't exit until they are killed. If problems are detected during startup, a diagnostic message is printed on standard error:

FATAL ERROR: Can't run as super-user

The super-user can't run merlinserver. This is to prevent potentially disastrous security violations.
Panic: Daylight option manager initialization failed!
The options manager couldn't read the options file, or found an invalid option. Possible causes are: DY_OPTIONS is wrong, or if it is not defined, DY_ROOT is wrong; you don't have read access to options files or to a directory in the path to the options files.
Can't open passwords file file.
The passwords file (defined by the option DATABASE_PASSWORDS_FILE) couldn't be opened with write permission. Note that it and the directory it is in must be writable, even if you don't plan to make changes to it.
FATAL ERROR: Can't open logfile file.
The specified log file couldn't be opened for writing.
Invalid license: message.
Your license is not valid; message gives the reason.
Killed: <pid>
On SGI machines running pre-5.x IRIX, your server may be killed because some OTHER process used too much memory. This is error and its remedy are describe in detail in "readme-sgi" in the directory where you installed you Daylight software.


Start the merlinserver with a specified log file:
merlinserver -MERLIN_LOG_FILE /usr/local/tmp/merlin.log
Start the merlinserver and load three databases:
merlinserver medchem95b aquire95 mydb
Start the merlinserver, load 2 databases, and enable parallel processing on a 4-CPU machine:
merlinserver -MERLIN_NPROCS 4 medchem95b aquire95



Daylight License

servers: merlin

Related Topics

merserv_monitor(1) thorserv_monitor(1) licensing(5)
Daylight Theory Manual
Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. See: for more details.


It is possible for the Merlin server to use all available memory on your system, which is generally a drag. See the option -MERLIN_MEMORY_LIMIT, above.