juli3nk / csf-post-docker

CSF with support for Docker
56 stars 34 forks source link

Script is not running correctly when CSF refreshes the rules automatically, but works fine when used together with csf -r. #19

Open panomitrius opened 3 years ago

panomitrius commented 3 years ago

This script is not running correctly when CSF refreshes the rules automatically, but works fine when used together with csf -r. According to the CSF readme any binaries inside such a script as this must be run with full paths provided:

Note: While csf runs the script with a preset PATH, you MUST use the full path to any binaries that you execute within these scripts to ensure they are run correctly

This post also mentions the full path criteria. I'll test that myself when I have time to monitor the effects.

panomitrius commented 3 years ago

Confirming that adding the full path to each iptables and docker command in the script makes it work fine. In my case on Ubuntu 20.04 it's /usr/sbin/iptables and /usr/bin/docker.

panomitrius commented 3 years ago

Maybe this solution should be in the official README, I don't think I'm the only one who will run into this issue.