cancel
Showing results for 
Search instead for 
Did you mean: 

Howto: delay dbremote start on linux until server ready?

Former Member
3,458

A small question:

How do we delay starting dbremote until the dbsrv10 is ready to accept requests ?

We have setup dbeng10 and dbremote to start in the correct order as services in linux (Ubuntu 10.04.2 LTS). But when the system boots, dbeng10 is started correctly, but the server takes 5-10 seconds until it's ready to accept requests.

The dbremote process is started directly after dbeng10 and then fails with a connection error (because the db is not yet ready...)

Is there a way to delay the start of dbremote until the database server is ready ?

Until now we just did put a "sleep 20" in the start of the dbremote service, but this then also delays starting all other services by 20 seconds.... 😞

André

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Have a look at the RetryConnectionTimeout connection parameter. You should be able to set it to a reasonable value and dbremote will keep trying to connect every 0.5 seconds until either the connection is successful, the connection fails for a reason other than "database server not found," or the timeout is exceeded.

Note that you probably don't want to wait indefinitely in case your database server never does successfully start for some reason.

Former Member
0 Kudos

Works fine, thanks.

Answers (1)

Answers (1)

MarkCulp
Participant

Use the dbsvc -rs <dep> switch to specify the SA server service name when you define your dbremote service name. This will tell Linux to not start the dbremote service until the SA server service has been started.

Alternatively you could edit the dbremote service definition in /etc/init.d to specify a dependency of your deremote service on your SQL Anywhere server service. E.g. add the name of your SA server service to the Required-Start comment line near the top of the init.d file. After making the change to the service file you will need to tell Linux to "shuffle" the start and stop order. How you do this depends on the Linux distro - e.g. use chkconfig or update-rc.d

Former Member
0 Kudos

Our service scripts date back from sql anywhere version 9, so perhaps we should look at the new functionality 😉

Thanks