Skip to content

Fixes IPSet updating and adds Ubuntu support#3

Open
asasfu wants to merge 6 commits into
mighq:masterfrom
sfu-rcg:master
Open

Fixes IPSet updating and adds Ubuntu support#3
asasfu wants to merge 6 commits into
mighq:masterfrom
sfu-rcg:master

Conversation

@asasfu
Copy link
Copy Markdown

@asasfu asasfu commented Oct 22, 2015

IPSets previously could not be updated if they were in use by iptables. This fixes that by using swap instead of destroy and create. Makes this much more usable in an automated environment.
Added Ubuntu support with the option to tell it you use another init system like upstart if you didn't choose systemd as your init system.
Included Ray's PR as it is useful. Added systemctl daemon-reload instead of symlink creation to allow more flexibility and moved the service file to /etc/systemd/system instead of /usr/lib... as it's more correct and OS agnostic.

Ray Arachelian and others added 6 commits July 22, 2015 16:44
Possibly supports Ubuntu 15.04 upstart as well but untested.
Added the use of systemctl daemon-reload instead of file link for better
systemd target handling, same effect at the moment but if someone
changes the target this is more flexible.
Needed to add path options in exec so that Ubuntu works as well.  Moved
systemd service file location to /etc/systemd/system as
/usr/lib/systemd/system and Ubuntu, /lib/systemd/system are meant for
packages themselves (apt, rpm) to deploy their service files,
/etc/systemd/system will be the winning file though.  Plus
/etc/systemd/system is identical between RHEL and Debian base systems.
Previously ipset updates to ipsets that already existed tried to destroy and then create the list.  You cannot destroy a list actively in use by IPTables.  In this case we checked the diff between the active ipset and the proposed ipset, if it found a difference it now creates a new temporary in-memory ipset and then swaps them in-place and then proceeds to remove that temporary in-memory ipset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants