service.control

Perform the control operation given by verb (START, STOP, RESTART, or RELOAD) on the system service named service. This is the general entry point for managing the running state of a service; the configured enable-on-boot setting is changed separately via service.update.

The result reflects whether the service is running after a START, RESTART, or RELOAD, or whether it was successfully stopped for a STOP. By default failures are reported by returning false rather than raising; set options.silent to false to receive an error instead.

This method is a job.

Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: verb

verb

Type: enum (of string)

The service operation to perform.

Must be one of:
  • "START"
  • "STOP"
  • "RESTART"
  • "RELOAD"
Parameter 2: service

service

Type: string

Name of the service to control.

Parameter 3: options

options

Type: object

Options for controlling the service operation behavior.

No Additional Properties

Ha Propagate

Type: boolean Default: true

Whether to propagate the service operation to the HA peer in a high-availability setup.

Silent

Type: boolean Default: true

Return false instead of an error if the operation fails.

Timeout

Default: 120

Maximum time in seconds to wait for the service operation to complete. null for no timeout.

Type: integer
Type: null

Result

Type: boolean

For "START", "RESTART", "RELOAD", indicate whether the service is running after performing the operation. For "STOP", indicate whether the service was successfully stopped.



Required roles: SERVICE_WRITE | SHARING_FTP_WRITE | SHARING_ISCSI_WRITE | SHARING_NFS_WRITE | SHARING_NVME_TARGET_WRITE | SHARING_SMB_WRITE