Project

General

Profile

« Previous | Next » 

Revision d7f7ab4f

Added by Jim Pingle almost 7 years ago

Solve a package reinstall/start race condition. Fixes #9045

(cherry picked from commit 84963037949aaf5225ae664cfe9b4e3b037beee0)

View differences:

src/etc/rc.package_reinstall_all
26 26
$max_tries = 5;
27 27

  
28 28
mark_subsystem_dirty('packagelock');
29
unlink_if_exists("{$g['conf_path']}/needs_package_sync");
30 29

  
31 30
/* If it's still booting, give it a few seconds before start */
32 31
if (platform_booting()) {
......
41 40
	$ntries++;
42 41
}
43 42

  
43
unlink_if_exists("{$g['conf_path']}/needs_package_sync");
44

  
44 45
if ($ntries > $max_tries) {
45 46
	file_notice(gettext("Package reinstall"), gettext("Package reinstall " .
46 47
	    "process was ABORTED due to lack of internet connectivity"));
47 48
} else {
48 49
	file_notice(gettext("Package reinstall"), gettext("Package reinstall " .
49 50
	    "process finished successfully"));
51
	mwexec_bg("{$g['etc_path']}/rc.start_packages");
50 52
}
51 53

  
52 54
/* Detect installed binary pkgs that are not registered in the system */
src/etc/rc.start_packages
39 39
	}
40 40
}
41 41

  
42
if (file_exists("{$g['conf_path']}/needs_package_sync")) {
43
	log_error("Skipping STARTing packages process because package reinstallation is pending.");
44
	return;
45
}
46

  
42 47
@file_put_contents("{$g['tmp_path']}/.rc.start_packages.running", "");
43 48

  
44 49
log_error("Restarting/Starting all packages.");

Also available in: Unified diff