cancel
Showing results for 
Search instead for 
Did you mean: 

Timing start of Mobilink Client service

former_member329524
Active Participant
0 Kudos

Hello, all

We have a situation where some of our smaller clients need to sync their data using Mobilink.

The mobilink service is automatically started when the machine starts. So does the DB service, whos data is being synced.

The problem is that the Mobilink client service starts before the DB service is up. So, it cannot connect to the DB and stops.

Is there a simple way to tell the Mobilnk client to start later or to wait and not shutdown if the db server is not found?

Obviously, we could write a code in the DB event, which can run a batch file, which restarts the service if the subscriptions are inactive, but I was hoping for something simple in the service configuration.

Anyone had this problem before?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Arcady,

if these are Windows OS services, you can set a dependency on the Mobilink client service to only start once the DB service has started.

See the dbsvc.exe -rs switch in this link

Service Utility

or you can add it in the Service properties in Sybase Central.

Thanks

Mark

former_member329524
Active Participant
0 Kudos

Thank you, Mark

That solves our problem

former_member329524
Active Participant
0 Kudos

A followup question, though

Is there a way not to shutdown Mobilink client service if the the DB service goes down unexpectedly?

It will come up again, but the Mobilink service will not.

jeff_albion
Employee
Employee
0 Kudos

Hi Arcady,

You can potentially run a batch file when the service stops, and have that batch file restart other services. The trick is getting the batch file to run invisibly in the background when the service restarts to avoid the Interactive Services Detection issue.

Here's how I got a dbmlsync service to restart automatically when the remote database server process is killed:

  1. I set up two services, dbsrv16_svc and dbmlsync_svc:

  2. The dbmlsync_svc has a dependency to dbsrv16_svc:

  3. I've created a batch file (e.g. restartservices.cmd) to restart my services, in order (you can omit the dbsrv16 calls, if desired, due to the dependency):

    net stop "SQL Anywhere - dbmlsync_svc"
    net stop "SQL Anywhere - dbsrv16_svc"
    net start "SQL Anywhere - dbsrv16_svc"
    net start "SQL Anywhere - dbmlsync_svc"
  4. I've created a VBScript wrapper (e.g. invis.vbs) to launch an argumented batch file in the background (invisible mode):

    CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
  5. I go into my services panel and in the dbsrv16_svc Recovery options set up the paths to WSCRIPT with my VBS and CMD files as the arguments:

  6. Back in Task Manager, I find my two Service processes running:

  7. Now if I PsKill the dbsrv16 service (from an Administrator Command Prompt), both services are gone:

    pskill 5048

  8. A few seconds later, both services are back:

Hope that helps,

Jeff Albion

SAP Active Global Support

Answers (0)