Skip to main content
Actions

Manage service

How to start, stop, or restart a service or change its start type with the Manage service action, and when the step fails.

Manage service controls a system service on the device: start, stop, restart, or change its start type. The device must be online.

Configuration fields

FieldTypeRequiredDefaultDescription
Service nametextYes—The service name, not the display name, for example Spooler. On Linux this is the systemd unit, on macOS the label of a system launch daemon. Supports variables ${{ … }}.
ActionselectionYesRestartStart, Stop, Restart, or Change start type
Start typeselectionYes, for Change start typeAutomaticAutomatic, Manual, or Disabled. Only shown when Action is Change start type. Automatic is the regular automatic start, not a delayed start

You can find the service name in the device's Services tab, next to the display name.

Platform support

PlatformSupported
WindowsYes
LinuxYes, except Change start type
macOSYes, except Change start type

Outputs

OutputDescription
successSucceeded: true if the device carried out the action, otherwise false. Missing if the device did not answer
serviceNameService name: the service name with variables resolved

Result behaviour

CaseResult
The service is unknown (except for Stop on Windows and macOS), access is denied, or the operating system rejects the actionFailed. The error message is in the step details
The service name is empty after variables are resolvedFailed
Change start type on Linux or macOSFailed
The device is offline when the step startsDevice offline. Depending on If device is offline, the run ends with this status or the step is skipped.
The device does not answer in timeTimed out, the outcome is unknown

You can safely repeat Start and Stop. If the service is already running, Start succeeds and leaves it alone. On Windows, Stop on a service that is already stopped also counts as success. On Windows and macOS, Stop even succeeds for a service that does not exist on the device, so a typo in the name goes unnoticed.

Restart stops a running service and starts it again. A stopped service is simply started. The agent waits up to 25 seconds for a service to start or stop. If it takes longer, the step fails or times out.

Platform details:

  • Linux: If a unit fails to start, the agent enables it and tries once more. If that works, the unit now also starts at boot.
  • macOS: Start loads a launch daemon that is not loaded yet from /Library/LaunchDaemons/<name>.plist.

Stopping or restarting a service interrupts every application and user that depends on it. With Disabled, the service does not start until you change the start type again. Test on a single device first, and limit Windows-only steps with a condition.

See also: Create an automation · Monitor Device Performance Live · Service Status