fix: skip firewalld port config when firewalld is not running#1
Draft
Copilot wants to merge 2 commits into
Draft
fix: skip firewalld port config when firewalld is not running#1Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/jiangtj-lab/1Panel/sessions/b610dba9-27f5-46b8-95da-72c54e695e27 Co-authored-by: jiangtj <15902347+jiangtj@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jiangtj-lab/1Panel/sessions/b610dba9-27f5-46b8-95da-72c54e695e27 Co-authored-by: jiangtj <15902347+jiangtj@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jiangtj
May 9, 2026 03:50
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On openEuler, firewalld is installed by default but not started.
NewFirewallClient()was selecting firewalld purely based on binary presence (cmd.Which), causing any subsequentfirewall-cmdinvocation to trigger D-Bus socket activation — starting firewalld and applying port rules without user intent.Changes
agent/utils/firewall/client.go: InNewFirewallClient(), after detecting the firewalld binary, check if the service is actually running viacontroller.CheckActive("firewalld")before returning a firewalld client. If not active, fall through to iptables. Check errors are logged at debug level.This aligns the agent with the existing behavior in
core/utils/firewall/firewall.go, which already gates firewall-cmd calls behind a running-state check.