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

agent fails to detect active firewalld.service on Fedora 40 #2

Open
mjg opened this issue Aug 15, 2024 · 1 comment
Open

agent fails to detect active firewalld.service on Fedora 40 #2

mjg opened this issue Aug 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working c:agent-rust (>=3.0) Related to agent writen in Rust, so since version 3.0
Milestone

Comments

@mjg
Copy link

mjg commented Aug 15, 2024

Title says it all and possibly affects everyone with similar systemd versions.

.../Inventory/Generic/Firewall/Systemd.pm runs systemctl status firewalld.service and matches with this regexp:
/^\s*Loaded: loaded [^;]+firewalld[^;]*; [^;]*;[^\n]*\n\s*Active: active \(running\)/

Over here (Fedora Linux 40 with systemd-255.10 and firewalld-2.1.3), the status output is the following:

● firewalld.service - firewalld - dynamic firewall daemon
     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Tue 2024-08-13 15:17:30 CEST; 2 days ago
       Docs: man:firewalld(1)
   Main PID: 847 (firewalld)
      Tasks: 2 (limit: 8997)
     Memory: 46.4M (peak: 46.6M)
        CPU: 887ms
     CGroup: /system.slice/firewalld.service
             └─847 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid

My limited regexp fu seems to tell me that the expression expects "Loaded" and "Active" lines to be consecutive (while they are not). My limitations keep me from submitting a better regexp, though. Maybe we want check for those two lines with two regexps?

Alternatively, firewall-cmd --state might give the best check (to the extent that this just as the above says nothing about the config being tight, of course).

@ddurieux
Copy link
Member

Hi,

the regex will be:

[^;]+firewalld[^;]; [^;];[^\n]\n\s(Active: active|Loaded: loaded)
(running)/

I will fix it in version 3.0 currently in development.

@ddurieux ddurieux self-assigned this Aug 16, 2024
@ddurieux ddurieux added the bug Something isn't working label Aug 16, 2024
@ddurieux ddurieux transferred this issue from fusioninventory/fusioninventory-agent Sep 2, 2024
@ddurieux ddurieux added the c:agent-rust (>=3.0) Related to agent writen in Rust, so since version 3.0 label Sep 2, 2024
@ddurieux ddurieux added this to the Agent 3.0 milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c:agent-rust (>=3.0) Related to agent writen in Rust, so since version 3.0
Projects
None yet
Development

No branches or pull requests

2 participants