fix(packaging): Require online network in systemd unit file for Loki and Promtail (#12741)

From https://systemd.io/NETWORK_ONLINE/:

**How do I make sure that my service starts after the network is really online?**

That depends on your setup and the services you plan to run after it (see above). If you need to delay you service after network connectivity has been established, include

```systemd
After=network-online.target
Wants=network-online.target
```

in the `.service` file.

This will delay boot until the network management software says the network is “up”. For details, see the next question.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
pull/12868/head
Christian Haudum 1 year ago committed by GitHub
parent 8b34751e17
commit 57f78b574a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      tools/packaging/loki.service
  2. 5
      tools/packaging/promtail.service

@ -1,6 +1,7 @@
[Unit]
Description=Loki service
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
@ -12,4 +13,4 @@ Restart = on-failure
RestartSec = 2
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

@ -1,6 +1,7 @@
[Unit]
Description=Promtail service
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
@ -12,4 +13,4 @@ Restart = on-failure
RestartSec = 2
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

Loading…
Cancel
Save