svn commit: r470559 - in head/sysutils: boxbackup boxbackup-devel boxbackup-devel/files boxbackup/files

Alan Somers asomers at FreeBSD.org
Mon May 21 16:02:29 UTC 2018


Author: asomers (src committer)
Date: Mon May 21 16:02:27 2018
New Revision: 470559
URL: https://svnweb.freebsd.org/changeset/ports/470559

Log:
  sysutils/boxbackup*: use anticongestion sleep in the periodic job
  
  Use an anticongestion sleep in the periodic job to prevent the thundering
  herd problem when many systems' cron jobs fire off at once.
  
  PR:		218448
  PR:		218449
  Approved by:	portmaster at bsdforge.com (maintainer)

Modified:
  head/sysutils/boxbackup-devel/Makefile
  head/sysutils/boxbackup-devel/files/999.boxbackup.in
  head/sysutils/boxbackup/Makefile
  head/sysutils/boxbackup/files/999.boxbackup.in

Modified: head/sysutils/boxbackup-devel/Makefile
==============================================================================
--- head/sysutils/boxbackup-devel/Makefile	Mon May 21 16:02:09 2018	(r470558)
+++ head/sysutils/boxbackup-devel/Makefile	Mon May 21 16:02:27 2018	(r470559)
@@ -3,6 +3,7 @@
 
 PORTNAME=	boxbackup
 PORTVERSION=	0.11.r${SVNVERSION:C/^[0-9\.]+_[a-z]+_([0-9]+)/\1/}
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.boxbackup.org/snapshots/201108/
 PKGNAMESUFFIX=	${CLIENT_OR_SERVER}-devel

Modified: head/sysutils/boxbackup-devel/files/999.boxbackup.in
==============================================================================
--- head/sysutils/boxbackup-devel/files/999.boxbackup.in	Mon May 21 16:02:09 2018	(r470558)
+++ head/sysutils/boxbackup-devel/files/999.boxbackup.in	Mon May 21 16:02:27 2018	(r470559)
@@ -38,12 +38,30 @@ then
 	source_periodic_confs
 fi
 
+SLEEP=/bin/sleep
+JOT=/usr/bin/jot
+
+random() {
+	${JOT} -r 1 0 900
+}
+
 rc=0
 
 case "$monthly_boxbackup_compare_enable" in
 	[Yy][Ee][Ss])
 		echo
 		echo "Running Box Backup store compare:"
+		# When non-interactive, sleep to reduce congestion on rkhunter
+		# site
+		if [ "$1" != -nodelay ]; then
+			# In FreeBSD 12.0 the anticongestion function should
+			# be used instead of a hard-coded sleep
+			if [ -n "$anticongestion_sleeptime" ]; then
+				anticongestion
+			else
+				${SLEEP} $(random)
+			fi
+		fi
 		%%PREFIX%%/sbin/bbackupquery -q "compare -c $monthly_boxbackup_compare_args" quit
 
 		# Return codes:

Modified: head/sysutils/boxbackup/Makefile
==============================================================================
--- head/sysutils/boxbackup/Makefile	Mon May 21 16:02:09 2018	(r470558)
+++ head/sysutils/boxbackup/Makefile	Mon May 21 16:02:27 2018	(r470559)
@@ -3,7 +3,7 @@
 
 PORTNAME=	boxbackup
 PORTVERSION=	0.11.1
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	sysutils
 MASTER_SITES=	SF
 PKGNAMESUFFIX=	${CLIENT_OR_SERVER}

Modified: head/sysutils/boxbackup/files/999.boxbackup.in
==============================================================================
--- head/sysutils/boxbackup/files/999.boxbackup.in	Mon May 21 16:02:09 2018	(r470558)
+++ head/sysutils/boxbackup/files/999.boxbackup.in	Mon May 21 16:02:27 2018	(r470559)
@@ -38,12 +38,30 @@ then
 	source_periodic_confs
 fi
 
+SLEEP=/bin/sleep
+JOT=/usr/bin/jot
+
+random() {
+	${JOT} -r 1 0 900
+}
+
 rc=0
 
 case "$monthly_boxbackup_compare_enable" in
 	[Yy][Ee][Ss])
 		echo
 		echo "Running Box Backup store compare:"
+		# When non-interactive, sleep to reduce congestion on rkhunter
+		# site
+		if [ "$1" != -nodelay ]; then
+			# In FreeBSD 12.0 the anticongestion function should
+			# be used instead of a hard-coded sleep
+			if [ -n "$anticongestion_sleeptime" ]; then
+				anticongestion
+			else
+				${SLEEP} $(random)
+			fi
+		fi
 		%%PREFIX%%/sbin/bbackupquery -q "compare -c $monthly_boxbackup_compare_args" quit
 
 		# Return codes:


More information about the svn-ports-all mailing list