Skip to main content

Schedule service restart


For one reason or another, the need to schedule a restart of the AVIX Server service may arise. For instance, in the AVIX5.0 train we've hade experiences at customers when the SFV stops answering. 

NET START can be used to start Windows services. NET STOP can be used to stop Windows services.

When typed at the command prompt, service names of two words or more must be enclosed in quotation marks. For example, NET START "Solme AviXServer" starts the Solme AviXServer service.

Some web resources on Windows task scheduler: 


INSTRUCTIONS

We will define two tasks: one that will bring the server down, and one that will start the server again. Let's also leave a bit of space in-between, say 10 minutes, to give the server a chance to shutdown gracefully. 

Preparations before DEFINING "stop" and "start" tasks

  1. Open the Windows Services Management Console by typing "services.msc" in the run box.
    1. image.png

  2. Locate the AVIX Server service and open its properties.
  3. Take note of the Service name for future use:
    1. image.png

  4. Open the Task Scheduler by typing Task in the Windows search box:
    1. image.png

  5. Create a dedicated folder named "AVIXTasks", where we will define our tasks:
    1. image.png



Define "Stop" Task

  1. Select Create a Basic Task from the Actions list on the right:
    1. image.png

  2. Name the task Stop AVIX Server:
    1. image.png

  3. Click Next and select Weekly Trigger:
    1. image.png

  4. Pick time(s) when there will be little activity/usage. We select 01:00 AM, two days/week here:
    1. image.png

  5. Click Next and for the Action select Start a program:
    1. image.png

  6. For the Program/Script type NET and add the arguments  Stop "SolmeAviXServer" (i.e. the service name):
    1. image.png

  7. Before Finishing, select the Open the Properties dialog option:
    1. image.png

  8. In the General tab select Run whether user is logged in or not and Run with highest privileges:
    1. image.png

The task we have now defined will stop the AVIX Server service, twice weekly at a chosen time.


Define "start" Task

We will start AVIX Server 10 minutes later, to give the Windows Service some time to close all pending tasks before restarting.

  1. Select Create a Basic Task from the Actions list on the right.
  2. Name the task Start AVIX Server:
    1. image.png

  3. Set the Trigger to start Weekly at 10 minutes after the stop time set previously:
    1. image.png

  4. Click Next and for the Action select Start a program.
  5. For the Program/Script type NET and add the arguments  Start "SolmeAviXServer" (i.e. the service name):
    1. image.png

  6. Before Finishing, select the Open the Properties dialog option as before.
  7. In the General tab, select Run whether user is logged in or not and Run with highest privileges.


Summary

You have now created two scheduled tasks, one will stop the AVIX Server service and the other will start it again 10 minutes later. The overview of the tasks look like this:

image.png