service_restart
Restart a TrueNAS system service with dry-run preview; requires explicit confirmation for SSH to avoid disrupting remote access.
Instructions
[WRITE] Restart a system service (e.g. 'smb', 'nfs'). Pass dry_run=True to preview.
Captures the prior service state for the audit record; declares no undo (a restart is not cleanly reversible).
Refuses a service name that is not present in service_list, and refuses 'ssh' unless confirm=True — SSH is the out-of-band recovery path, and bouncing it can strand whoever is working over it. Both refusals apply under dry_run too, which must report a refusal rather than preview a call that will be refused.
Args: service: TrueNAS service name (see service_list). confirm: Required (True) only to restart 'ssh'; ignored otherwise. dry_run: If True, preview without restarting. target: TrueNAS target name from config.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| confirm | No | ||
| dry_run | No | ||
| service | Yes |