Project

General

Profile

« Previous | Next » 

Revision 586c623a

Added by Jim Pingle over 6 years ago

Deprecate the built-in relayd Load Balancer. Closes #9386

It is not available on FreeBSD 12 with OpenSSL 1.1.x.

Users can migrate to the HAProxy package.

View differences:

src/etc/inc/upgrade_config.inc
941 941
	if (count($config['load_balancer']) == 0) {
942 942
		unset($config['load_balancer']);
943 943
	}
944
	mwexec('/usr/sbin/pw groupadd -n _relayd -g 913');
945
	mwexec('/usr/sbin/pw useradd -n _relayd -c "Relay Daemon" -d /var/empty -s /usr/sbin/nologin -u 913 -g 913');
946 944
}
947 945

  
948 946

  
......
5942 5940
	install_cron_job("/usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 webConfiguratorlockout", false, null, null, null, null, null, null, false);
5943 5941
}
5944 5942

  
5943
/* Deprecate relayd Load Balancer
5944
 * See https://redmine.pfsense.org/issues/9386 */
5945
function upgrade_191_to_192() {
5946
	global $config;
5947

  
5948
	/* Backup LB config */
5949
	$backup_file = "/conf/deprecated_load_balancer.xml";
5950
	unlink_if_exists($backup_file);
5951
	file_put_contents($backup_file, backup_config_section('load_balancer'));
5952

  
5953
	/* Determine if LB was active and notify (or log if not) */
5954
	$deprecation_notice = sprintf(gettext("The built-in Load Balancer service has been deprecated. The active Load Balancer configuration has been stored in %s. Consider migrating to the HAProxy package."), $backup_file);
5955
	if (is_array($config['load_balancer']['virtual_server']) &&
5956
	    count($config['load_balancer']['virtual_server']) &&
5957
	    count($config['load_balancer']['lbpool'])) {
5958

  
5959
		if (!function_exists("file_notice")) {
5960
			require_once("notices.inc");
5961
		}
5962
		file_notice("Load Balancer", $deprecation_notice);
5963
	} else {
5964
		log_error("INFO: {$deprecation_notice}");
5965
	}
5966

  
5967
	/* Clear old config */
5968
	unset($config['load_balancer']);
5969

  
5970
	/* Remove LB HA Sync Config */
5971
	if (isset($config['hasync']) &&
5972
	    is_array($config['hasync']) &&
5973
	    isset($config['hasync']['synchronizelb'])) {
5974
		unset($config['hasync']['synchronizelb']);
5975
	}
5976
	
5977
	/* If the LB widget is present, remove it*/
5978
	if (isset($config['widgets']) &&
5979
	    isset($config['widgets']['sequence']) &&
5980
	    (strpos($config['widgets']['sequence'], 'load_balancer_status') !== false)) {
5981
		$widgets = explode(',', trim($config['widgets']['sequence']));
5982
		foreach ($widgets as $idx => &$widget) {
5983
			if (substr( $widget, 0, 20 ) === "load_balancer_status") {
5984
				unset($widgets[$idx]);
5985
			}
5986
		}
5987
		$config['widgets']['sequence'] = implode(',', $widgets);
5988
	}
5989

  
5990
	/* Per-log settings */
5991
	if (isset($config['syslog']) &&
5992
	    is_array($config['syslog']) &&
5993
	    isset($config['syslog']['relayd_settings'])) {
5994
		unset($config['syslog']['relayd_settings']);
5995
	}
5996
}
5997

  
5945 5998
/*
5946 5999
 * Special function that is called independent of current config version. It's
5947 6000
 * a workaround to have config_upgrade running on older versions after next

Also available in: Unified diff