summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2018-08-20 15:17:27 -0300
committerRenato Botelho <renato@netgate.com>2018-08-20 15:17:44 -0300
commit96d05f1daf40c158f06d75e0cda7fb22a4e9f49b (patch)
tree2f8835e0c97a560497bfa6812f28eadafc9d9f1f /src
parentb3cd2eb41666e8c2e35c5ea1d2dea0862d12e6c8 (diff)
downloadpfsense-96d05f1daf40c158f06d75e0cda7fb22a4e9f49b.zip
pfsense-96d05f1daf40c158f06d75e0cda7fb22a4e9f49b.tar.gz
Try to run upgrade script 3 times
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/pkg_mgr_install.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index a359726..ae7ab23 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -608,23 +608,26 @@ if (!isvalidpid($gui_pidfile) && $confirmed && !$completed) {
}
if (isset($params)) {
- $upgrade_script = "{$pfsense_upgrade} -y -l " .
- "{$logfilename}.txt -p {$sock_file}";
+ for ($idx = 0; $idx < 3; $idx++) {
+ $upgrade_script = "{$pfsense_upgrade} -y -l " .
+ "{$logfilename}.txt -p {$sock_file}";
- unlink_if_exists($sock_file);
- $execpid = mwexec_bg("{$upgrade_script} {$params}");
+ unlink_if_exists($sock_file);
+ $execpid = mwexec_bg("{$upgrade_script} {$params}");
- // Make sure the upgrade process starts
- while (posix_kill($execpid, 0) && !file_exists(
- $sock_file)) {
- sleep(1);
- }
+ // Make sure the upgrade process starts
+ while (posix_kill($execpid, 0) && !file_exists(
+ $sock_file)) {
+ sleep(1);
+ }
- if (posix_kill($execpid, 0) && file_exists(
- $sock_file)) {
- $start_polling = true;
- @file_put_contents($gui_pidfile, $execpid);
- @file_put_contents($gui_mode, $mode);
+ if (posix_kill($execpid, 0) && file_exists(
+ $sock_file)) {
+ $start_polling = true;
+ @file_put_contents($gui_pidfile, $execpid);
+ @file_put_contents($gui_mode, $mode);
+ break;
+ }
}
}
}
OpenPOWER on IntegriCloud