From patchwork Thu Mar 28 13:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1068208 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="TS3shBQo"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VQxy42b1z9s9N for ; Fri, 29 Mar 2019 00:41:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 92319261F6; Thu, 28 Mar 2019 13:41:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3lD-2qJo-A0f; Thu, 28 Mar 2019 13:41:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7120925C74; Thu, 28 Mar 2019 13:41:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id F36A61BF2F5 for ; Thu, 28 Mar 2019 13:41:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EE5A684558 for ; Thu, 28 Mar 2019 13:41:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qvAAlDw9xHA5 for ; Thu, 28 Mar 2019 13:41:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CD83E84476 for ; Thu, 28 Mar 2019 13:41:07 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id w1so23000282wrp.2 for ; Thu, 28 Mar 2019 06:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=nkXsciUhAXW86pZkJ0+4NMfvXs1a7NI2EYVXc2SFluw=; b=TS3shBQoiGA0gJxQNfMXpoLyFwrsK4xJW/EFzYAoHbdj4qWnzmIlpF4QgKhped9Akv 6RyURTfx74OnNxHyD4oKftlUQ6DCk7q+307H+fLYUTX+n/piYMhXEWwRfUpk+gUiRA6V egUulSBRcAuIY5wQ3Nvd7OhyNIXritw6ghfqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nkXsciUhAXW86pZkJ0+4NMfvXs1a7NI2EYVXc2SFluw=; b=bVvaPDZkpvUe0dHGouHoy4BzRJMyC+vy/SOw36uUYCJhYVlsvCHMZkQBhZ9d1v0Oct 2DTREhiTKH4oPPg9cNBwH5JKV2HX5tDkiYy5sp2RkcUx8q3JjpX5KUK/UHbAbmd+0RAo nNHrDild2+BfH0hIXS0S/8D1hwgwOBazqodIIix2SmVP1hSAQtP+qIv/5NKOIfrmQsPL Y+hZqbmLp0a6ghdLjh7+Jew4TVhyTfEiuiGa/nhJHCc1FGISmyo7a+cps+QcvRGquHPs njFH/ezPDXraHxMRq2HJt3A2RzhhmdGcp9DhBo9eHiyaGhGltJIqS49luCdQ849EiyGI l6ug== X-Gm-Message-State: APjAAAWQaf4SmPF+MmohtT8VDlWYuUG02jWxEEIac0AW59jN/L1RyWJt kZKIZIjZU4Bu+LO96wfWCCCKXPzFrzs= X-Google-Smtp-Source: APXvYqyOH5stIJnEt6rCFVdPtTfosjbgQ7rRMSAw+pPSV3mRu61nS4SyVzQwIz28sasCHfDpdZY/jw== X-Received: by 2002:adf:b601:: with SMTP id f1mr11097338wre.158.1553780465539; Thu, 28 Mar 2019 06:41:05 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 66sm8162667wmd.3.2019.03.28.06.41.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Mar 2019 06:41:04 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Thu, 28 Mar 2019 14:41:00 +0100 Message-Id: <1553780460-1429-1-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH] package/fail2ban: add fixup for default configuration X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" fail2ban default configuration is not compatible with buildroot as is. In order to not force the user to overwrite it in an overlay and having a fail2ban service running out of the box, this patch adds a fixup step to adapt the default configuration to running on buildroot. The dbfile is None to not add a dependency on BR2_PACKAGE_PYTHON_SQLITE. Signed-off-by: Angelo Compagnucci --- package/fail2ban/fail2ban.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk index b7e6bdc..0a3dd94 100644 --- a/package/fail2ban/fail2ban.mk +++ b/package/fail2ban/fail2ban.mk @@ -9,6 +9,13 @@ FAIL2BAN_SITE = $(call github,fail2ban,fail2ban,$(FAIL2BAN_VERSION)) FAIL2BAN_LICENSE = GPL-2.0+ FAIL2BAN_LICENSE_FILES = COPYING FAIL2BAN_SETUP_TYPE = distutils +FAIL2BAN_POST_INSTALL_TARGET_HOOKS = FAIL2BAN_FIX_DEFAULT_CONFIG + +define FAIL2BAN_FIX_DEFAULT_CONFIG + $(SED) '/^socket/c\socket = /run/fail2ban.sock' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf + $(SED) '/^pidfile/c\pidfile = /run/fail2ban.pid' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf + $(SED) '/^dbfile/c\dbfile = None' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf +endef define FAIL2BAN_INSTALL_INIT_SYSV $(INSTALL) -D -m 755 package/fail2ban/S60fail2ban \ @@ -22,6 +29,7 @@ define FAIL2BAN_INSTALL_INIT_SYSTEMD ln -fs ../../../../usr/lib//systemd/system/fail2ban.service \ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/fail2ban.service $(SED) 's,@BINDIR@,/usr/bin,g' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service + $(SED) '/^PIDFile/c\PIDFile=/run/fail2ban.pid' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service endef $(eval $(python-package))