Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 3, 2024

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Apr 23, 2024

What this PR does / why we need it:

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

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.

Which issue(s) this PR fixes:

Closes #12724

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Official documentation suggests to declare

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

See https://systemd.io/NETWORK_ONLINE/#FAQ

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Official documentation suggests to declare

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

See https://systemd.io/NETWORK_ONLINE/#FAQ

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@chaudum chaudum requested a review from a team as a code owner April 23, 2024 07:58
Copy link
Contributor

@MichelHollands MichelHollands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chaudum chaudum merged commit 57f78b5 into main May 3, 2024
58 checks passed
@chaudum chaudum deleted the chaudum/systemd-require-online-network branch May 3, 2024 06:55
shantanualsi pushed a commit that referenced this pull request May 6, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After=network.target should be After=network-online.target
2 participants