Sleep for a random time, up to two minutes, in ud-replicate when not called
authorPeter Palfrader <peter@palfrader.org>
Wed, 16 Apr 2008 12:09:51 +0000 (14:09 +0200)
committerPeter Palfrader <peter@palfrader.org>
Wed, 16 Apr 2008 12:09:51 +0000 (14:09 +0200)
interactively.  This is to prevent DoSing the db server when many clients come
at the same time.

debian/changelog
ud-replicate

index cab31a4..5202505 100644 (file)
@@ -13,6 +13,9 @@ userdir-ldap (0.3.15+xxx) XXunstable; urgency=low
     inetOrgPerson, that doesn't work.
   * Add myself to uploaders.
   * Create /var/lib/misc/thishost as a symlink to the hostname in postinst.
+  * Sleep for a random time, up to two minutes, in ud-replicate when not
+    called interactively.  This is to prevent DoSing the db server when
+    many clients come at the same time.
 
   [ Mark Hymers ]
   * ud-userimport, ud-groupadd, ud-roleadd, ud-useradd, userdir_ldap.py:
@@ -61,7 +64,7 @@ userdir-ldap (0.3.15+xxx) XXunstable; urgency=low
   * Build manpages at build time (add Build-Depend on yodl)
   * Install built manpages
 
- -- Peter Palfrader <weasel@debian.org>  Wed, 16 Apr 2008 14:05:44 +0200
+ -- Peter Palfrader <weasel@debian.org>  Wed, 16 Apr 2008 14:08:55 +0200
 
 userdir-ldap (0.3.15) unstable; urgency=low
 
index 0c17297..094dd46 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 #   Copyright (c) 1999-2001  Jason Gunthorpe <jgg@debian.org>
 #   Copyright (c) 2002-2003,2006  Ryan Murray <rmurray@debian.org>
@@ -24,6 +24,7 @@ set -e
 if [ -z "$TERM" -o "$TERM" = "dumb" ]
 then
     exec > /dev/null 2>&1
+    sleep $(( $RANDOM % 120 ))
 else
     verbose=-v
 fi