From c2419b0e309de8597916f5dc753d99120f416ff7 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 12 Jun 2015 03:57:56 -0400
Subject: [PATCH] - prevent failure of update check on debian system (on running dpkg process)

---
 server/lib/classes/cron.d/100-monitor_system_update.inc.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/classes/cron.d/100-monitor_system_update.inc.php b/server/lib/classes/cron.d/100-monitor_system_update.inc.php
index 35338dc..2eea785 100644
--- a/server/lib/classes/cron.d/100-monitor_system_update.inc.php
+++ b/server/lib/classes/cron.d/100-monitor_system_update.inc.php
@@ -82,7 +82,7 @@
 			 * Then test the upgrade.
 			 * if there is any output, then there is a needed update
 			 */
-			$aptData = shell_exec('apt-get -s -qq dist-upgrade');
+			$aptData = shell_exec('while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do sleep 2; done; apt-get -s -qq dist-upgrade');
 			if ($aptData == '') {
 				/* There is nothing to update! */
 				$state = 'ok';

--
Gitblit v1.9.1