STARTUP

This section contains the list of programs started when the DP4 service is started up.

The Win32 loader will accept two different syntaxes in this section. The two different syntaxes cannot be mixed. The old syntax is documented only because you may come across it in an existing DP4 configuration file file. It should no longer be used - the Windows CE loader and the loader for Unix (dbdaemon) only accept the new syntax.

New syntax:

1=[priority][Type]program_name_1 command tails
2=[priority][Type]program_name_2 command tails
3=[priority][Type]program_name_3 command tails
...

Old syntax:

program_name_1=command tails
program_name_2=command tails
program_name_3=command tails
...

In the old syntax, programs were loaded in the order in which their names were found in the file. In the new syntax, the loader looks in turn for the keys '1', '2', '3',... and uses the associated values as the command line to load.

The old syntax cannot handle the same program name twice; the Windows API returns the first set of command tails for the second program.

If no startup section is specified the [startup] section defaults to

1=dp4srvr.w32

or the equivalent command to load the stand-alone database manager on Unix, Windows CE etc.

The server programs such as TCPMGR and AUXDISTR are all service processes, (daemons) that run all the time. When the loader loads these, it must not wait for them to terminate. Instead it waits for them to signal or broadcast a message to indicate that they have completed initialisation. However, if the loader loads an application program such as DBRECOV or DBCHECK, it must wait until it terminates and check the return code before going on to the next program. The loader will stop the loading process if an application program returns a non-zero return code. It may also be required to load a program which does not terminate and does not signal that it has completed initialisation, or one that should not prevent DP4 from loading even if it itself fails to load.

To allow the loader to distinguish these various scenarios, the names of application programs (as distinct from TSRs) must be prefixed by various symbols.

Symbol Meaning
* Run to termination and check return code is 0
& Spawn and do not wait for a return code
! Wait for completion but ignore return code

If no type is given the program is a DP4 server program and must (on Windows) send a special message to the loader to say it is ready. (On Unix/Linux DP4 server programs are expected to terminate with a 0 exit code after forking to turn themselves into daemons). By default servers have 15 seconds to initialise (set with the startup_delay entry)

The [priority] settings are as follows:

< Very low
- Low
. Normal
+ High
> Very high

On Unix and Linux these priorities are all relative to the priority with which dbdaemon is started. "Very High" means the process has the same priority as dbdaemon, each of the other priority levels reduces the priority of the program by increasing its nice value by one point.

Example [PRELOAD] and [STARTUP] sections

[preload]
1=dp4srvr.w32
2=*dbrecov -db dbname
3=*dbcheck -db dbname -check -batch

[startup]
1 = tcpw.w32 -multiple -server 80
2 = dp4srvr.w32 -aux
3 = tcpmgr.w32 -server 80 -aux
4 = auxdistr.w32 -server 80 -use 80

Here is an example startup section for a Windows CE device that is also accessed from one or more PCs:

[startup]
1=.dp4srvr.wce -aux
2=tcpw.wce -server_name localhost -debug_connect
3=.tcpmgr.wce -aux -debug_connect

dp4srvr.wce and tcpmgr.wce are being run with "normal" rather than high priority to prevent the CE device being unresponsive while a PC is accessing it. In some cases it may even be necessary to run tcpmgr.wce with low priority:

3=-tcpmgr.wce -aux -debug_connect

Here is a similar startup section for a Linux or Unix computer

[startup]
1=srv3 -aux
2=tcp3 -server_name localhost -debug_connect
3=tcpmgr -display_address -aux -debug_connect

Alternative [STARTUP] and [PRELOAD] sections

The loader program will look for different section names instead of [startup] and [preload] if it is started with the command tails

 -startup startup_section_name

or

 -preload preload_section_name

This allows the user to have multiple startup configurations in the DP4 configuration file and to select the one required without editing the file.

If you use autoloading, you can specify the -startup and -preload command tails as part of the value for loader in the [WIN32] section, or as part of the value for loader in the [WINCE] section for Windows CE, or the [UNIX] section for Unix and Linux.