Manage Service
ubuntu_manage_serviceStart, stop, restart, reload, enable, or disable systemd services on Ubuntu servers remotely over SSH, with confirmation of service state after the action.
Instructions
Start, stop, restart, reload, enable, or disable a systemd service. Runs via 'sudo -n', so the server must allow passwordless sudo for the configured user.
Args:
server (string): server name from the inventory (see ubuntu_list_servers)
service (string): unit name, e.g. 'nginx'
action ('start' | 'stop' | 'restart' | 'reload' | 'enable' | 'disable'): what to do
Returns: confirmation plus the service's state after the action.
Error handling: if sudo requires a password the error explains how to configure passwordless sudo. 'reload' fails for services that don't support it — use 'restart' instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform on the service | |
| server | Yes | Server name from the inventory (see ubuntu_list_servers) | |
| service | Yes | systemd unit name, e.g. 'nginx' or 'nginx.service' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| server | Yes | ||
| service | Yes | ||
| state_after | Yes |