[Midnightbsd-cvs] mports [17769] trunk/security/sshguard: update rc script for sshguard
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Thu Oct 16 07:54:13 EDT 2014
Revision: 17769
http://svnweb.midnightbsd.org/mports/?rev=17769
Author: laffer1
Date: 2014-10-16 07:54:13 -0400 (Thu, 16 Oct 2014)
Log Message:
-----------
update rc script for sshguard
Modified Paths:
--------------
trunk/security/sshguard/Makefile
trunk/security/sshguard/files/pkg-message.in
trunk/security/sshguard/files/sshguard.in
Modified: trunk/security/sshguard/Makefile
===================================================================
--- trunk/security/sshguard/Makefile 2014-10-16 01:26:22 UTC (rev 17768)
+++ trunk/security/sshguard/Makefile 2014-10-16 11:54:13 UTC (rev 17769)
@@ -1,8 +1,8 @@
# $MidnightBSD$
PORTNAME= sshguard
-DISTVERSION= 1.5
-PORTREVISION= 1
+PORTVERSION= 1.5
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF/sshguard/sshguard/sshguard-${PORTVERSION}
@@ -15,45 +15,28 @@
CONFLICTS?= sshguard-ipfw-1.[0-9]* sshguard-pf-1.[0-9]* sshguard-ipfilter-1.[0-9]*
USES= tar:bzip2
-USE_AUTOTOOLS= autoconf
-MAKE_ARGS+= ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}"
+
+PLIST_FILES= sbin/sshguard man/man8/sshguard.8.gz
+
USE_RC_SUBR= sshguard
+MAKE_ARGS+= ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}"
GNU_CONFIGURE= yes
+CONFIGURE_ARGS+=--with-firewall=${SSHGUARDFW}
-# sublist will be set afterward
+SUB_LIST+= PKGMSG_FWBLOCK=${PKGMSG_FWBLOCK}
SUB_FILES= pkg-message
# backend type in { hosts, ipfw, pf }
SSHGUARDFW?= hosts
-.include <bsd.port.pre.mk>
-
-.if defined(PREFIX)
-CONFIGURE_ARGS+= --prefix=${PREFIX}
-.endif
-
-# set path for manpages
-CONFIGURE_ARGS+= --mandir=${MANPREFIX}/man
-
.if ${SSHGUARDFW} == pf
PKGMSG_FWBLOCK=" To activate or configure PF see http://sshguard.sf.net/doc/setup/blockingpf.html"
.elif ${SSHGUARDFW} == ipfw
PKGMSG_FWBLOCK=" Verify that IPFW is active with \"ipfw show\"."
+.elif ${SSHGUARDFW} == hosts
+PKGMSG_FWBLOCK=" Sshguard is going to use /etc/hosts.allow. Please remember to touch /etc/hosts.allow\!"
.elif ${SSHGUARDFW} == ipfilter
-PKGMSG_FWBLOCK="Sshguard will use /etc/ipf.rules as ruleset."
-.elif ${SSHGUARDFW} == hosts
-PKGMSG_FWBLOCK=" Sshguard is going to use /etc/hosts.allow, I have touched it for you."
+PKGMSG_FWBLOCK=" Sshguard will use /etc/ipf.rules as ruleset."
.endif
-# for substitution in subfiles
-SUB_LIST+= PKGMSG_FWBLOCK=${PKGMSG_FWBLOCK} PREFIX=${TRUE_PREFIX}
-
-CONFIGURE_ARGS+= --with-firewall=${SSHGUARDFW}
-
-#post-install:
-# @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-
-#pre-deinstall:
-# @PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} DEINSTALL
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Modified: trunk/security/sshguard/files/pkg-message.in
===================================================================
--- trunk/security/sshguard/files/pkg-message.in 2014-10-16 01:26:22 UTC (rev 17768)
+++ trunk/security/sshguard/files/pkg-message.in 2014-10-16 11:54:13 UTC (rev 17769)
@@ -2,7 +2,15 @@
%%PKGMSG_FWBLOCK%%
- Your /etc/syslog.conf has been added a line for sshguard; uncomment it
- and use "/etc/rc.d/syslogd reload" for activating it.
+ If you would like to use sshguard via syslogd, add an entry to your
+ /etc/syslog.conf like the following:
+
+ auth.info;authpriv.info |exec %%PREFIX%%/sbin/sshguard
+
+ and use "/etc/rc.d/syslogd reload" to activate it. Note, you can add
+ additional arguments to the sshguard command if you so desire.
+
+ Alternatively, you can also start sshguard as a daemon by using the
+ rc.d script installed at %%PREFIX%%/etc/rc.d/sshguard .
See sshguard(8) and http://sshguard.sourceforge.net for additional info.
Modified: trunk/security/sshguard/files/sshguard.in
===================================================================
--- trunk/security/sshguard/files/sshguard.in 2014-10-16 01:26:22 UTC (rev 17768)
+++ trunk/security/sshguard/files/sshguard.in 2014-10-16 11:54:13 UTC (rev 17769)
@@ -31,6 +31,7 @@
# PROVIDE: sshguard
# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable sshguard:
@@ -48,10 +49,10 @@
# by default.
# sshguard_safety_thresh (int): Safety threshold. Set to "40" by default.
# sshguard_pardon_min_interval (int):
-# Minimum pardon interval. Set to "1200"
+# Minimum pardon interval. Set to "420"
# by default.
# sshguard_prescribe_interval (int):
-# Prescribe interval. Set to "420" by
+# Prescribe interval. Set to "1200" by
# default.
# sshguard_whitelistfile (str): Path to the whitelist.
# Set to "%%PREFIX%%/etc/sshguard.whitelist"
@@ -60,33 +61,32 @@
. /etc/rc.subr
-name="sshguard"
-rcvar="sshguard_enable"
-command="/usr/sbin/daemon"
-actual_command="%%PREFIX%%/sbin/${name}"
-procname="${actual_command}"
+name=sshguard
+rcvar=sshguard_enable
-load_rc_config $name
+load_rc_config sshguard
-: ${sshguard_enable="NO"}
-: ${sshguard_pidfile="/var/run/${name}.pid"}
-: ${sshguard_blacklist="40:/var/db/sshguard/blacklist.db"}
-: ${sshguard_safety_thresh="40"}
-: ${sshguard_pardon_min_interval="1200"}
-: ${sshguard_prescribe_interval="420"}
+: ${sshguard_enable:=NO}
+: ${sshguard_blacklist=40:/var/db/sshguard/blacklist.db}
+: ${sshguard_safety_thresh=40}
+: ${sshguard_pardon_min_interval=420}
+: ${sshguard_prescribe_interval=1200}
: ${sshguard_whitelistfile="%%PREFIX%%/etc/sshguard.whitelist"}
-: ${sshguard_watch_logs="/var/log/auth.log:/var/log/maillog"}
+: ${sshguard_watch_logs=/var/log/auth.log:/var/log/maillog}
-pidfile="${sshguard_pidfile}"
-sshguard_watch_params=`echo ${sshguard_watch_logs} | tr : \\\n | sed -e s/^/-l\ /g | tr \\\n \ `
-start_precmd="${name}_prestart"
+pidfile=${sshguard_pidfile:="/var/run/sshguard.pid"}
-command_args="-cf ${actual_command} -b ${sshguard_blacklist} ${sshguard_watch_params} -a ${sshguard_safety_thresh} -p ${sshguard_pardon_min_interval} -s ${sshguard_prescribe_interval} -w ${sshguard_whitelistfile} -i ${sshguard_pidfile}"
+command=/usr/sbin/daemon
+actual_command="%%PREFIX%%/sbin/sshguard"
+procname="${actual_command}"
+start_precmd=sshguard_prestart
+command_args="-cf ${actual_command} -b ${sshguard_blacklist} \${sshguard_watch_params} -a ${sshguard_safety_thresh} -p ${sshguard_pardon_min_interval} -s ${sshguard_prescribe_interval} -w ${sshguard_whitelistfile} -i ${pidfile}"
sshguard_prestart()
{
mkdir -p `dirname ${sshguard_blacklist##*:}`
[ -e ${sshguard_whitelistfile} ] || touch ${sshguard_whitelistfile}
+ sshguard_watch_params=`echo ${sshguard_watch_logs} | tr : \\\n | sed -e s/^/-l\ /g | tr \\\n \ `
}
run_rc_command "$1"
More information about the Midnightbsd-cvs
mailing list