From 776322cea3d2fb6642bdf7904a5450f203f3705b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 31 Jul 2015 10:12:14 -0400 Subject: [PATCH] BF: realpath for /var/run/fail2ban Closes #1142 --- ChangeLog | 2 ++ setup.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5bcc77b..88748bd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,8 @@ ver. 0.9.3 (2015/XX/XXX) - wanna-be-released * kill the entire process group of the child process upon timeout (gh-1129). Otherwise could lead to resource exhaustion due to hanging whois processes. + * resolve /var/run/fail2ban path in setup.py to help installation + on platforms with /var/run -> /run symlink (gh-1142) - New Features: * RETURN iptables target is now a variable: diff --git a/setup.py b/setup.py index 44f11e62..e3c499d2 100755 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ except ImportError: from distutils.command.build_py import build_py from distutils.command.build_scripts import build_scripts import os -from os.path import isfile, join, isdir +from os.path import isfile, join, isdir, realpath import sys import warnings from glob import glob @@ -81,8 +81,9 @@ else: data_files_extra = [] if os.path.exists('/var/run'): # if we are on the system with /var/run -- we are to use it for having fail2ban/ - # directory there for socket file etc - data_files_extra += [('/var/run/fail2ban', '')] + # directory there for socket file etc. + # realpath is used to possibly resolve /var/run -> /run symlink + data_files_extra += [(realpath('/var/run/fail2ban'), '')] # Get version number, avoiding importing fail2ban. # This is due to tests not functioning for python3 as 2to3 takes place later