Thanks for your help,  I admit I am getting a bit perplexed.

Using the approach you suggest, the merovingian daemon uses the default mapi port, if set,  for the first database, then tries to start subsequent databses on the same port - with the expected result. I have shown the settings I am using in the monetdb5.conf file, the merovingian command (the one you provided) and the output from the merovingian log.

If I do not set a default mapi port, then the deamon tries to start all the databases on its default port (50000) and none start.

Using the approach we had, setting the port for each databse instance with a separate command works - with the issues aleady described in the earlier post.

Any further help with "what is wrong with this picture" will be appreciated.

Settings from monetdb5.conf
---------------------------------------
# merovingian port commented out, use default
# mero_port=50000

# mapi port set to 50001, allow remote access
mapi_port=50001         # default port to address a mserver
mapi_open=true            # should be set to 'true' to allow for remote access

Start up command
---------------------------------------
startproc -s -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/merovingian DATABASE1 DATABASE2 DATABASE3

Output from merovingian log
------------------------------------------

MSG merovingian[19017]: Merovingian 0.6 starting ...
MSG DATABASE1[19019]: executing '/local/monetdb/bin/mserver5' for database 'DATABASE1'
MSG merovingian[19017]: monitoring dbfarm /local/monetdb/var/MonetDB5/dbfarm
MSG merovingian[19017]: listening for connections on web:50000
MSG merovingian[19017]: starting database 'DATABASE1', up min/avg/max: 66/66/66, crash average: 0.00 0.00 0.00 (1-1=0)
MSG DATABASE1[19019]: # MonetDB server v5.3.0, based on kernel v1.21.0
MSG DATABASE1[19019]: # Serving database 'DATABASE1'
MSG DATABASE1[19019]: # Compiled for i686-pc-linux-gnu/32bit with 32bit OIDs dynamically linked
MSG DATABASE1[19019]: # Copyright (c) 1993-2007 CWI, all rights reserved
MSG DATABASE1[19019]: # Visit http://monetdb.cwi.nl/ for further information
MSG DATABASE1[19019]: # Listening for connection requests on mapi:monetdb://web:50001/
MSG merovingian[19017]: starting database 'DATABASE2', up min/avg/max: 66/66/66, crash average: 0.00 0.00 0.00 (1-1=0)
MSG DATABASE2[19022]: executing '/local/monetdb/bin/mserver5' for database 'DATABASE2'
MSG DATABASE2[19022]: # MonetDB server v5.3.0, based on kernel v1.21.0
MSG DATABASE2[19022]: # Serving database 'DATABASE2'
MSG DATABASE2[19022]: # Compiled for i686-pc-linux-gnu/32bit with 32bit OIDs dynamically linked
MSG DATABASE2[19022]: # Copyright (c) 1993-2007 CWI, all rights reserved
MSG DATABASE2[19022]: # Visit http://monetdb.cwi.nl/ for further information
MSG DATABASE2[19022]: !IOException:mal_mapi.listen:Binding to stream socket port 50001 failed: Address already in use
MSG DATABASE2[19022]: #function user.main():void;

## additional stak trace removed here

MSG merovingian[19017]: starting database 'DATABASE3', up min/avg/max: 56/56/56, crash average: 0.00 0.00 0.00 (1-1=0)
MSG DATABASE3[19040]: executing '/local/monetdb/bin/mserver5' for database 'DATABASE3'
MSG DATABASE3[19040]: # MonetDB server v5.3.0, based on kernel v1.21.0
MSG DATABASE3[19040]: # Serving database 'DATABASE3'
MSG DATABASE3[19040]: # Compiled for i686-pc-linux-gnu/32bit with 32bit OIDs dynamically linked
MSG DATABASE3[19040]: # Copyright (c) 1993-2007 CWI, all rights reserved
MSG DATABASE3[19040]: # Visit http://monetdb.cwi.nl/ for further information
MSG DATABASE3[19040]: !IOException:mal_mapi.listen:Binding to stream socket port 50001 failed: Address already in use
MSG DATABASE3[19040]: #function user.main():void;

## additional stak trace removed here
Fri 01 Feb 2008 03:49:43 AM EST from Fabian2 to monetdb-users@lists.sourceforge.net
Subject: Re: [MonetDB-users] Running multiple mserver5 processes, Merovingian port allocation

McKennirey.Matthew wrote:
>
> We are running multiple mserver5 processes under a single merovingian
> daemon. Our start up script looks like this:
>
> # start the merovingian daemon, the port for the daemon is defined in
> $MDB_HOME/etc/monetdb5.conf
> startproc -s -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/merovingian
>
> echo "Starting DATABASE1."
> startproc -f -t 5 -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/mserver5
> --dbname=DATABASE1 --dbinit="include sql;" --set mapi_port=50010 &
>
> echo "Starting DATABASE2"
> startproc -f -t 5 -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/mserver5
> --dbname=DATABASE2 --dbinit="include sql;" --set mapi_port=50011 &
>
> echo "Starting DATABASE3."
> startproc -f -t 5 -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/mserver5
> --dbname=DATABASE3 --dbinit="include sql;" --set mapi_port=50012 &
>
> echo -e "Done"
>

This is not how merovingian is meant to be used. If you start mservers
yourself next to merovingian, merovingian cannot control those mservers.
The result you see is that merovingian starts to assign the databases to
other ports after they have crashed.

If you want to have merovingian start those databases immediately upon
startup, give the database names to the merovingian startup:

startproc -s -u $MDB_USER -g $MDB_GROUP $MDB_BINDIR/merovingian DATABASE1
DATABASE2 DATABASE3

merovingian will never retain port numbers, as it simply looks for a free
port, which is enough given that you should always connect through
merovingian (port 50000).

I hope this helps.
--