> ## Documentation Index
> Fetch the complete documentation index at: https://stellar-relay.xdr.ooo/llms.txt
> Use this file to discover all available pages before exploring further.

# Run continuously with systemd

> Keep the relay running at boot, recover from failures, and inspect service logs.

Run the relay as a `systemd` service so it starts with the host and automatically recovers from process failures.

## Create the service unit

Create:

```text theme={null}
/etc/systemd/system/stellar-alert-case.service
```

Example:

```ini theme={null}
[Unit]
Description=Stellar Cyber Alert + Case Syslog daemon
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=aella
Group=aella
WorkingDirectory=/home/aella/kt
ExecStart=/usr/bin/python3 /home/aella/kt/Stellar_Alert_Case_Syslog.py \
  --alert-interval 60 \
  --case-interval 3600 \
  --alert-syslog-ip 10.10.10.20 \
  --alert-syslog-port 5201 \
  --case-syslog-ip 10.10.10.20 \
  --case-syslog-port 5142 \
  --case-include-summary \
  --no-case-format-summary \
  --case-fetch-timeout 90
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
```

<Warning>
  Replace the example user, group, working directory, script path, destination addresses, and ports with values for your environment.
</Warning>

## Enable and start

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable --now stellar-alert-case.service
sudo systemctl status stellar-alert-case.service
```

After changing the unit file:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl restart stellar-alert-case.service
```

## Follow service logs

```bash theme={null}
journalctl -u stellar-alert-case.service -f
```

To inspect the effective unit file:

```bash theme={null}
systemctl cat stellar-alert-case.service
```

## Automatic recovery

The recommended service settings are:

```ini theme={null}
Restart=on-failure
RestartSec=10
```

This allows `systemd` to restart the daemon after a process failure without creating an immediate tight restart loop.

## Operational features

The relay is designed for continuous operation and includes:

* Fetch checkpointing
* Send retry/recovery
* Backfill
* Separate alert and case destinations

## Operational tips

* Keep `Restart=on-failure` enabled for automatic process recovery.
* Use `--debug` only when troubleshooting.
* Verify TCP reachability from the relay host to every configured destination.
* Use separate alert and case listeners when the downstream workflows differ.
* After editing the unit file, always run `systemctl daemon-reload` before restarting the service.

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/configuration">
    Review stream requirements and available options.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/troubleshooting">
    Diagnose configuration and delivery problems.
  </Card>
</CardGroup>
