# RestartService

The `RestartService` action stops a service, waits until the process has stopped, and then starts the service again.

## Example

    a=RestartService&Port=9000

    a=RestartService&Port=9000&ControlMethod=Process&Timeout=60

    a=RestartService&Port=41600&ConfigContent=%5BServer%5D%0APort=41400%0A%5BService%5D%0AServicePort=41402%0A%5Bssdp%5D%0AssdpPort=41404

Before it starts the service, the `RestartService` action first tries to stop the service by using the control method specified in the `ControlMethod` parameter, then by using SCM, then by using a server process.

NOTE: You must have Windows administrator privileges to use this action.

## Required Parameters

The following action parameters are required.

Parameter | Description
--- | ---
Port | The port of the service.

## Optional Parameters

This action accepts the following optional parameters.

Parameter | Description
--- | ---
ControlMethod | The control method to use to start the service.
StopControlMethod | The control method to use to stop the service.

## Comments

You can also submit this action from Coordinator by specifying the `ControllerUUID` parameter. By default, the action is asynchronous, but you can run it synchronously by setting the `Synchronous` parameter to `True`.

If the response is successful, the response contains the following information:

- A token for the Controller server (`<ControllerToken>`).
- The request port number (`<Port>`).
- The UUID of the Controller server in question (as specified by the `ControllerUUID` parameter).

You can use the token with the `QueueInfo` action to find the status of the action. For example:

`action=SendAction&ControllerUUID=<UUID>&Command=QueueInfo&QueueAction=GetStatus&QueueName=<Action>&Token=<ControllerToken>`

If the response fails, it contains an error. Usually this is as a result of an issue with the underlying Controller server, or as a result of an issue with Coordinator itself if the Controller server is down.

For more information, refer to the Coordinator Reference.

## See Also

- AddService
- EditServiceInfo
- FindServices
- GetServices
- RemoveService
- StartService
- StopService

_FT_HTML5_bannerTitle.htm