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

Override DefaultDependencies on ipset service unit #64

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

sagepe
Copy link
Contributor

@sagepe sagepe commented Feb 25, 2022

Pull Request (PR) description

The current ipset service unit sets Before=network-pre.target as it is needed before the network to help ensure that the firewall is up and running before anyone might actually try to connect. It has no setting
for DefaultDependencies which means it takes the defaults, one of which is After=sysinit.target.

There are some cases where this can cause a dependency cycle with other units that want to start early in the boot process between networking.service and sysinit.target (for example, cloud-init). This results in one of the offending units being removed and risks startup continuing without ipsets being configured, potentially leaving a firewall open and a host at risk.

The ipset service can safely be run before sysinit.target by setting DefaultDependencies=no with a couple of additional dependencies to handle some of the other implied settings that are removed as a result.

This Pull Request (PR) fixes the following issues

Fixes #63

@sagepe
Copy link
Contributor Author

sagepe commented Jun 1, 2022

Is there any feedback on this PR? (I'm not entirely sure why the Archlinux test failed, but I note that it's failing on other PRs). Thanks!

@bastelfreak
Copy link
Member

Hi @sagepe , thanks for the PR. Can you please rebase against our latest master branch?

The current ipset service unit sets `Before=network-pre.target` as it is
needed before the network to help ensure that the firewall is up and
running before anyone might actually try to connect. It has no setting
for `DefaultDependencies` which means it takes the defaults, one of
which is `After=sysinit.target`.

There are some cases where this can cause a dependency cycle with other
units that want to start early in the boot process between
`networking.service` and `sysinit.target` (for example, cloud-init).
This results in one of the offending units being removed and risks
startup continuing without ipsets being configured, potentially leaving
a firewall open and a host at risk.

The ipset service can safely be run before `sysinit.target` by setting
`DefaultDependencies=no` with a couple of additional dependencies to
handle some of the other implied settings that are removed as a result.

Fixes voxpupuli#63
@sagepe
Copy link
Contributor Author

sagepe commented Nov 14, 2022

Done!

@bastelfreak bastelfreak added the bug Something isn't working label Nov 14, 2022
@bastelfreak bastelfreak merged commit 2611784 into voxpupuli:master Nov 14, 2022
@sagepe sagepe deleted the 63-systemd-dependencies branch February 9, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential for systemd dependency cycles
2 participants