From owner-svn-ports-all@freebsd.org Mon May 21 16:02:29 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF4FEF5C0B; Mon, 21 May 2018 16:02:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C441183F06; Mon, 21 May 2018 16:02:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C6B270BB; Mon, 21 May 2018 16:02:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4LG2Sua054325; Mon, 21 May 2018 16:02:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4LG2RUc054322; Mon, 21 May 2018 16:02:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201805211602.w4LG2RUc054322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 21 May 2018 16:02:27 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r470559 - in head/sysutils: boxbackup boxbackup-devel boxbackup-devel/files boxbackup/files X-SVN-Group: ports-head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sysutils: boxbackup boxbackup-devel boxbackup-devel/files boxbackup/files X-SVN-Commit-Revision: 470559 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 16:02:29 -0000 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@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: