summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-08-16 09:00:33 -0300
committerRenato Botelho <renato@netgate.com>2017-08-16 11:03:04 -0300
commit9fe2e86a8792fd5edbb0e951c927d460cbfe73db (patch)
treeaa22de398124ae212f806f3895aa9a85b680a9dd
parent3aef796c756c618c061d9e1576a3f05a697d9976 (diff)
downloadpfsense-9fe2e86a8792fd5edbb0e951c927d460cbfe73db.zip
pfsense-9fe2e86a8792fd5edbb0e951c927d460cbfe73db.tar.gz
Move workaround used to enable pkg metadata update cronjob to a generic mechanism
-rw-r--r--src/etc/inc/upgrade_config.inc35
-rwxr-xr-xsrc/etc/rc.bootup30
2 files changed, 35 insertions, 30 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index 2d215ff..dc00ee1 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -5067,6 +5067,41 @@ function upgrade_157_to_158() {
*/
function additional_config_upgrade() {
global $config;
+
+ if (!is_array($config['system']['already_run_config_upgrade'])) {
+ $config['system']['already_run_config_upgrade'] = array();
+ }
+ $already_run =& $config['system']['already_run_config_upgrade'];
+
+ /* Copy of upgrade_168_to_169() from 2.4 */
+ if (!isset($already_run['upgrade_168_to_169'])) {
+ $command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata';
+
+ $found = false;
+ if (is_array($config['cron']['item'])) {
+ foreach ($config['cron']['item'] as $entry) {
+ if ($entry['command'] == $command) {
+ $found = true;
+ break;
+ }
+ }
+ }
+
+ if (!$found) {
+ $config['cron']['item'][] = array(
+ 'minute' => '1',
+ 'hour' => '0',
+ 'mday' => '*',
+ 'month' => '*',
+ 'wday' => '*',
+ 'who' => 'root',
+ 'command' => $command
+ );
+ }
+
+ $already_run['upgrade_168_to_169'] = true;
+ }
+
}
?>
diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup
index fc3121d..ff65eb1 100755
--- a/src/etc/rc.bootup
+++ b/src/etc/rc.bootup
@@ -331,36 +331,6 @@ if ($realmem > 0 and $realmem < 65) {
system_webgui_start();
}
-/* Workaround to add pkg metadata update cronjob on 2.3 */
-if (!isset($config['cron']['rc_update_pkg_metadata'])) {
- $command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata';
-
- $found = false;
- if (is_array($config['cron']['item'])) {
- foreach ($config['cron']['item'] as $entry) {
- if ($entry['command'] == $command) {
- $found = true;
- break;
- }
- }
- }
-
- if (!$found) {
- $config['cron']['item'][] = array(
- 'minute' => '1',
- 'hour' => '0',
- 'mday' => '*',
- 'month' => '*',
- 'wday' => '*',
- 'who' => 'root',
- 'command' => $command
- );
- }
-
- $config['cron']['rc_update_pkg_metadata'] = true;
- write_config("Registered rc.update_pkg_metadata cronjob");
-}
-
/* configure cron service */
echo "Configuring CRON...";
configure_cron();
OpenPOWER on IntegriCloud