From 08ad92c2cf2663e16df9ecf2a6ffb95bdf5cf63d Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 23 Jun 2010 15:38:36 -0400 Subject: Sleep dynamically based on whether or not squid is running at the time, rather than waiting constantly and slowing down the boot time. --- config/squid/squid.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config/squid') diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 752d8376..54150805 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -1120,14 +1120,17 @@ function squid_resync() { if (!is_service_running('squid')) { log_error("Starting Squid"); - mwexec_bg("/usr/local/sbin/squid -D"); + mwexec("/usr/local/sbin/squid -D"); } else { log_error("Reloading Squid for configuration sync"); mwexec("/usr/local/sbin/squid -k reconfigure"); } // Sleep for a couple seconds to give squid a chance to fire up fully. - sleep(5); + for ($i=0; $i < 10; $i++) { + if (!is_service_running('squid')) + sleep(1); + } filter_configure(); conf_mount_ro(); } -- cgit v1.2.3