# noust service

Manage the systemd services Noust owns.

```bash
noust service [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`create`](#noust-service-create), [`delete`](#noust-service-delete), [`list`](#noust-service-list), [`logs`](#noust-service-logs), [`restart`](#noust-service-restart), [`start`](#noust-service-start), [`status`](#noust-service-status), [`stop`](#noust-service-stop), [`tag`](#noust-service-tag)

## noust service create

Create a service and install its unit file.

```bash
noust service create [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--name`, `-n` | Name for the new service. |  |
| `--command`, `-c` | Command the service runs. |  |
| `--directory`, `-d` | Directory the command runs in. |  |
| `--user`, `-u` | Account to run as. | `www-data` |
| `--description` | Short description shown by systemd. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service delete

Stop a service, disable it and remove its unit file.

```bash
noust service delete [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--force`, `-f`, `-y` | Delete without asking for confirmation. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service list

List services and whether they are running.

```bash
noust service list [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--all`, `-a` | Include units Noust does not own. |  |
| `--state` | Only the units in this state; failed also keeps the ones systemd keeps restarting. |  |
| `--tag` | Only the units that carry this tag. |  |
| `--json` | Print the service list as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service logs

Show the journal for a service.

```bash
noust service logs [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--follow`, `-f` | Keep printing new entries until interrupted. |  |
| `--lines`, `-n` | How many past entries to show. | `50` |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service restart

Restart a service.

```bash
noust service restart [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service start

Start a service.

```bash
noust service start [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service status

Show whether a service is running and enabled.

```bash
noust service status [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--json` | Print the status as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service stop

Stop a service.

```bash
noust service stop [OPTIONS] NAME
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service tag

Free labels on services, to find them by.

```bash
noust service tag [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`add`](#noust-service-tag-add), [`list`](#noust-service-tag-list), [`remove`](#noust-service-tag-remove), [`set`](#noust-service-tag-set)

## noust service tag add

Give a service more tags.

```bash
noust service tag add [OPTIONS] NAME TAGS...
```

Arguments: `name`, `tags`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service tag list

List the tags of a service, or every tagged one.

```bash
noust service tag list [OPTIONS] [NAME]
```

Arguments: `name`

| Option | What it does | Default |
|---|---|---|
| `--tag` | Only the services with this tag. |  |
| `--json` | Print the tags as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service tag remove

Take tags off a service.

```bash
noust service tag remove [OPTIONS] NAME TAGS...
```

Arguments: `name`, `tags`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust service tag set

Make a service carry exactly these tags (none clears them).

```bash
noust service tag set [OPTIONS] NAME [TAGS]...
```

Arguments: `name`, `tags`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

