BF: realpath for /var/run/fail2ban Closes #1142

pull/1144/head
Yaroslav Halchenko 2015-07-31 10:12:14 -04:00
parent c37009aec7
commit 776322cea3
2 changed files with 6 additions and 3 deletions

View File

@ -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: <returntype>

View File

@ -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