Package: vzctl
Version: 3.0.24-12
Severity: normal
Tags: patch

I sent this a few months ago, but it seems to have been eaten by a
faulty MTA setup :-(.

With multiple Debian VEs installed on a host, load spikes occur
corresponding with cron job execution.

On investigation, it appeared that /etc/vz/dists/scripts/postcreate.sh
randomises run-times of entries in /etc/crontab, but doesn't touch stuff
under /etc/cron.d/

I'm not entirely sure that this patch is the correct answer (maybe it'll
break things like rsnapshot - which needs to have it's entries run in the
originally-specified order) - but it is at least a start...

Tim.

-- System Information:
Debian Release: 6.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-openvz-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages vzctl depends on:
ii  iproute                       20100519-3 networking and traffic control too
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib
ii  vzquota                       3.0.12-3   server virtualization solution - q

Versions of packages vzctl recommends:
ii  rsync                         3.0.7-2    fast remote file copy program (lik

vzctl suggests no packages.

-- Configuration Files:
/etc/vz/cron/vz changed [not included]
/etc/vz/dists/scripts/debian-set_hostname.sh changed [not included]
/etc/vz/vz.conf changed [not included]

-- no debconf information

*** /tmp/openvz-postcreate-randomize-cron.d-too.patch
--- postcreate.sh.old   2010-09-14 06:07:31.000000000 +0100
+++ /etc/vz/dists/scripts/postcreate.sh 2011-08-03 09:27:22.490356610 +0100
@@ -24,12 +24,12 @@
 
 function randcrontab()
 {
-       file=${VE_ROOT}"/etc/crontab"
+       for file in ${VE_ROOT}/etc/cron.d/* ${VE_ROOT}/etc/crontab
+       do
+               [ -f "${file}" ] || return 0
 
-       [ -f "${file}" ] || return 0
-
-       /bin/cp -fp ${file} ${file}.$$
-       cat ${file} | awk '
+               /bin/cp -fp ${file} ${file}.$$
+               cat ${file} | awk '
 BEGIN { srand(); }
 {
        if ($0 ~ /^[ \t]*#/ || $0 ~ /^[ \t]+*$/) {
@@ -61,8 +61,9 @@
        }
        print line;
 }
-' > ${file}.$$ && /bin/mv -f ${file}.$$ ${file}
-       /bin/rm -f ${file}.$$ 2>/dev/null
+               ' > ${file}.$$ && /bin/mv -f ${file}.$$ ${file}
+               /bin/rm -f ${file}.$$ 2>/dev/null
+       done
 }
 
 function disableroot()



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to