From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jan 31 11:30:19 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 761A11065670 for ; Tue, 31 Jan 2012 11:30:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4A2848FC18 for ; Tue, 31 Jan 2012 11:30:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0VBUJim093359 for ; Tue, 31 Jan 2012 11:30:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0VBUJZZ093356; Tue, 31 Jan 2012 11:30:19 GMT (envelope-from gnats) Date: Tue, 31 Jan 2012 11:30:19 GMT Message-Id: <201201311130.q0VBUJZZ093356@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Matthias Fechner Cc: Subject: Re: ports/164659: fail2ban overwrite config files X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Fechner List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 11:30:19 -0000 The following reply was made to PR ports/164659; it has been noted by GNATS. From: Matthias Fechner To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Cc: Subject: Re: ports/164659: fail2ban overwrite config files Date: Tue, 31 Jan 2012 12:27:58 +0100 This is a multi-part message in MIME format. --------------020808050508030908080707 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit what do you think about the attached patch? That should make clear how to configure and prevent the overwrite of the config file with an update. Bye Matthias --------------020808050508030908080707 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="fail2ban.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fail2ban.patch" diff -urN py-fail2ban.old/Makefile py-fail2ban/Makefile --- py-fail2ban.old/Makefile 2012-01-31 12:19:28.247134384 +0100 +++ py-fail2ban/Makefile 2012-01-31 12:13:04.901139503 +0100 @@ -23,6 +23,7 @@ USE_PYDISTUTILS= yes USE_RC_SUBR= fail2ban +SUB_FILES= pkg-message SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} PYDISTUTILS_INSTALLARGS+= --install-purelib=${PYTHON_SITELIBDIR} \ @@ -38,4 +39,7 @@ post-patch: @${ECHO_CMD} ${FILES} | ${XARGS} ${REINPLACE_CMD} -e 's,/etc/fail2ban,${ETCDIR},g' +post-install: + @${CAT} ${PKGMESSAGE} + .include diff -urN py-fail2ban.old/files/pkg-message.in py-fail2ban/files/pkg-message.in --- py-fail2ban.old/files/pkg-message.in 1970-01-01 01:00:00.000000000 +0100 +++ py-fail2ban/files/pkg-message.in 2012-01-31 12:18:31.331132519 +0100 @@ -0,0 +1,19 @@ + +To complete the configuration: + +1. Copy the standard config file to a local one: + cp %%ETCDIR%%/jail.conf %%ETCDIR%%/jail.local + +2. Add new jails in the jail.local, e.g. for ssh: +[ssh-pf] +enabled = true +filter = bsd-sshd +action = pf[name=SSH, port=ssh, protocol=tcp] +logpath = /var/log/auth.log + +3. Enable fail2ban + Edit /etc/rc.conf to enable it. + +4. Start it + Use the start script in /usr/local/etc/rc.d/fail2ban start + --------------020808050508030908080707--