> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/linux/start-linux-service.md).

# Start Linux Service

Starts one systemd service on a Linux host by running `systemctl start <service>` over SSH. The host is the one defined in the SSH connection you choose, not the devices the workflow collected.

### Before you begin

* An SSH connection created and tested in **Action Center** > **Settings** > **SSH Configurations** (see [Action Center Settings](broken://pages/daed11d520fa03d16ef01d2e588ad217dff3e360)). The job runs on that connection's host.
* The service name must contain only letters, digits, underscore, dot and hyphen. Anything else fails with **Invalid service name**.
* If you turn on Use Sudo, the SSH user needs a passwordless (`NOPASSWD`) sudoers rule, because the command runs without a terminal.

### Settings

| Setting        | Type      | Required | Default | Description                                                                                                                                 |
| -------------- | --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| SSH connection | Selection | Yes      | None    | The SSH connection to run on, chosen by name from the connections you created in **Action Center** > **Settings** > **SSH Configurations**. |
| Service name   | Text      | Yes      | None    | Name of the service, for example `nginx`. Letters, digits, `_`, `.` and `-` only.                                                           |
| Use Sudo       | Checkbox  | No       | Off     | Run the command through sudo (`sudo -n`). Requires a passwordless (`NOPASSWD`) sudoers rule for the SSH user.                               |

### How it works

The job runs once per workflow run, not once per asset. It opens the chosen SSH connection and runs `systemctl start <Service name>`. With Use Sudo on, the command is run as `sudo -n systemctl start <Service name>`. The collected assets are not used.

If the SSH connection no longer exists, the job fails with **SSH settings not found**. If the command exits with a non-zero status, the job fails with the SSH connection name, the exit status and the error output.

The command waits up to the Timeout of the SSH connection (0 means the product default). The connection status in the SSH list is updated after each run.

On success the job passes the assets it received on to the next node unchanged.

### Example

```
SSH connection: web-server-01
Service name:   nginx
Use Sudo:       On
```

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/ae3b117733c8a5fb0f9274b4d23b4322d1cb7fad">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save default values and SSH connections for jobs.</td><td><a href="broken://pages/daed11d520fa03d16ef01d2e588ad217dff3e360">Broken link</a></td></tr><tr><td><strong>Stop Linux Service</strong></td><td>Run systemctl stop.</td><td><a href="broken://pages/6dd8d4302394ee8653b0a8b62d66e4fe344a09a8">Broken link</a></td></tr><tr><td><strong>Restart Linux Service</strong></td><td>Run systemctl restart.</td><td><a href="broken://pages/4f660b74982fa9532ccfba40eea95badf285c7b3">Broken link</a></td></tr></tbody></table>
