Project

General

Profile

« Previous | Next » 

Revision db3b3afb

Added by Jim Pingle almost 8 years ago

Use an alternate method to stop unbound and fix #7326

(cherry picked from commit 782453b4dbb77e5bc97a43f56b95a006c5434d65)
(cherry picked from commit 67fea036201f5af338338f6113033574ec25777e)

View differences:

src/etc/inc/services.inc
2289 2289
		echo "services_unbound_configure() being called $mt\n";
2290 2290
	}
2291 2291

  
2292
	// kill any running Unbound instance
2293
	if (file_exists("{$g['varrun_path']}/unbound.pid")) {
2294
		sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
2295
	}
2296

  
2297 2292
	if (isset($config['unbound']['enable'])) {
2293
		require_once('/etc/inc/unbound.inc');
2294

  
2295
		/* Stop Unbound using TERM */
2296
		if (file_exists("{$g['varrun_path']}/unbound.pid")) {
2297
			sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
2298
		}
2299

  
2300
		/* If unbound is still running, wait up to 30 seconds for it to terminate. */
2301
		for ($i=1; $i <= 30; $i++) {
2302
			if (is_process_running('unbound')) {
2303
				sleep(1);
2304
			}
2305
		}
2306

  
2298 2307
		if (platform_booting()) {
2299 2308
			echo gettext("Starting DNS Resolver...");
2300 2309
		} else {
......
2306 2315
			$return = 1;
2307 2316
		}
2308 2317

  
2309
		require_once('/etc/inc/unbound.inc');
2310 2318
		sync_unbound_service();
2311 2319
		if (platform_booting()) {
2312 2320
			echo gettext("done.") . "\n";
2313 2321
		}
2314 2322

  
2315 2323
		system_dhcpleases_configure();
2324
	} else {
2325
		/* kill Unbound since it should not be enabled */
2326
		if (file_exists("{$g['varrun_path']}/unbound.pid")) {
2327
			sigkillbypid("{$g['varrun_path']}/unbound.pid", "KILL");
2328
		}
2316 2329
	}
2317 2330

  
2318 2331
	if (!platform_booting() && $restart_dhcp) {

Also available in: Unified diff