Thanks for the reply.
I can write a wrapper script to start DRb before mongrel but the DRb start script in script\backgroundrb\start doesn't accept -p (port) argument.
I can't use service for the same reason and also because I am running multiple mongrels (from same app folder) on the same machine and for each I want to start the DRb at different port.
Any idea on how I can do this..
Are you running multiple mongrels for just one app? Or are you running multiple sites of the same codebase? If you are running the same app on multiple mongrels then you do not want to run each drb server on its own port as this will cause all kinds of errors. Because each request that comes into your app will go to a different mongrel backend so you are not gauranteed to get the same MiddleMan that is holding your jobs.
On the other hand if each drb server you want to run is running for a whole app then you can use the -c option to tell the drb server where to look for a config file. So you would create a separate backgroundrb.yml file for each drb server you want to run, ie: backgroundrb1.yml, backgroundrb2.yml, etc... Then when you start the drb server for each app you use the -c option to tell it where to read its config from:
script/backgroundrb/start -c /path/to/configfile.yml