Skip to content

Check if firewalld is running by asking firewalld if it is running #46658

@corhere

Description

@corhere

Description

The firewalld integration for libnetwork currently probes for whether firewalld is running by testing whether the org.fedoraproject.FirewallD1.getDefaultZone D-Bus method can be called without error. While effective, it is technically abusing the interface to infer the state of firewalld from whether or not it is able to service D-Bus RPC calls.

In addition to its own bespoke interfaces, firewalld exposes several properties through the standard D-Bus property interface. Notably, the state property signals whether firewalld is starting up, operational or failed (in an error state but still servicing D-Bus requests). We should switch to getting the state property, and do something sensible when the state is INIT or FAILED. Perhaps we could even subscribe to org.freedesktop.DBus.Properties.PropertiesChanged signals for the property and react to INIT -> RUNNING transitions instead of polling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions