SOLVED csf status same regardless on or off

jeffschips

Well-Known Member
Jun 5, 2016
221
23
68
new york
cPanel Access Level
Root Administrator
Hello.

All over the internet the wisdom to determine if csf is on or off is to run the command:

service csf status

Yet, if I first bring down csf with csf -x and then run that command, I see:

Code:
service csf status
Redirecting to /bin/systemctl status csf.service
● csf.service - ConfigServer Firewall & Security - csf
   Loaded: loaded (/usr/lib/systemd/system/csf.service; enabled; vendor preset: disabled)
   Active: active (exited) since Tue 2021-06-08 10:09:55 EDT; 14h ago
  Process: 891 ExecStart=/usr/sbin/csf --initup (code=exited, status=0/SUCCESS)
 Main PID: 891 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/csf.service
Jun 08 10:09:48 xxxxxx.com systemd[1]: Starting ConfigServer Firewall & Security - csf...
Jun 08 10:09:55 xxxxxx.com systemd[1]: Started ConfigServer Firewall & Security - csf.
Jun 08 10:09:55 xxxxxx.com csf[891]: (restoring ipsets) (restoring iptables) (restoring ip6tables)
which is the exact output I get if I enable and run the same command. . .
 

quietFinn

Well-Known Member
Feb 4, 2006
1,379
172
193
Finland
cPanel Access Level
Root Administrator
AFAIK command csf -l tells you if csf is on or off (actually if it's enabled or disabled).
 

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
52
103
Houston
cPanel Access Level
Root Administrator
Hello ! It looks like this occurs as csf -x doesn't fully disable the service but rather disable it in a manner where its IP table configurations no longer take effect. I did, however, find the following commands that may help:

6. List/Show the IPv4 iptables configuration
csf -l
Or
csf --status


7. List/Show the IPv6 ip6tables configuration
csf -l6
Or
csf --status6
I hope that this helps! If you have any other questions or concerns, please let us know!