From 6fa9f38c0c1377ab110ff97d0ba552c878e9e07e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 31 Jul 2015 15:40:46 -0300 Subject: Drop support for jail platform --- etc/inc/filter.inc | 4 +--- etc/inc/interfaces.inc | 7 ------- etc/inc/openvpn.inc | 3 --- etc/inc/services.inc | 12 ++---------- etc/inc/system.inc | 19 ++----------------- etc/inc/util.inc | 21 ++++++--------------- etc/inc/vpn.inc | 10 ---------- 7 files changed, 11 insertions(+), 65 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 73614f8..e9e7a03 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -162,9 +162,7 @@ function is_bogonsv6_used() { function filter_pflog_start($kill_first = false) { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } + if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "filter_pflog_start() being called $mt\n"; diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a192591..4d9389a 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -190,9 +190,6 @@ function interface_netgraph_needed($interface = "wan") { function interfaces_loopback_configure() { global $g; - if ($g['platform'] == 'jail') { - return; - } if (platform_booting()) { echo gettext("Configuring loopback interface..."); } @@ -1002,10 +999,6 @@ function interface_gif_configure(&$gif, $gifkey = "") { function interfaces_configure() { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } - /* Set up our loopback interface */ interfaces_loopback_configure(); diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 6e81c03..d74aa3e 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -1107,9 +1107,6 @@ function openvpn_resync($mode, $settings) { function openvpn_resync_all($interface = "") { global $g, $config; - if ($g['platform'] == 'jail') { - return; - } openvpn_create_dirs(); if (!is_array($config['openvpn'])) { diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 1412f7e..8eb6c6a 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -45,10 +45,6 @@ define('DYNDNS_PROVIDER_DESCRIPTIONS', 'City Network,CloudFlare,Custom,Custom (v function services_radvd_configure($blacklist = array()) { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } - if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_radvd_configure() being called $mt\n"; @@ -1567,9 +1563,7 @@ EOD; function services_dhcrelay_configure() { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } + if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_dhcrelay_configure() being called $mt\n"; @@ -1634,9 +1628,7 @@ function services_dhcrelay_configure() { function services_dhcrelay6_configure() { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } + if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_dhcrelay6_configure() being called $mt\n"; diff --git a/etc/inc/system.inc b/etc/inc/system.inc index a215e72..d7c6226 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -41,9 +41,7 @@ function activate_powerd() { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } + if (is_process_running("powerd")) { exec("/usr/bin/killall powerd"); } @@ -119,10 +117,6 @@ function system_get_sysctls() { function activate_sysctls() { global $config, $g, $sysctls; - if ($g['platform'] == 'jail') { - return; - } - if (is_array($config['sysctl']) && is_array($config['sysctl']['item'])) { foreach ($config['sysctl']['item'] as $tunable) { if ($tunable['value'] == "default") { @@ -454,9 +448,6 @@ function system_hosts_generate() { function system_dhcpleases_configure() { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } /* Start the monitoring process for dynamic dhcpclients. */ if ((isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcp'])) || (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcp']))) { @@ -519,9 +510,7 @@ function system_hostname_configure() { function system_routing_configure($interface = "") { global $config, $g; - if ($g['platform'] == 'jail') { - return; - } + if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_routing_configure() being called $mt\n"; @@ -1638,10 +1627,6 @@ function system_ntp_configure($start_ntpd=true) { $statsdir = "/var/log/ntp"; $gps_device = '/dev/gps0'; - if ($g['platform'] == 'jail') { - return; - } - safe_mkdir($statsdir); if (!is_array($config['ntpd'])) { diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 169f784..b2c797b 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -1836,13 +1836,11 @@ function get_memory() { } function mute_kernel_msgs() { - global $config; + global $g, $config; // Do not mute serial console. The kernel gets very very cranky // and will start dishing you cannot control tty errors. - switch (trim(file_get_contents("/etc/platform"))) { - case "nanobsd": - case "jail": - return; + if ($g['platform'] == 'nanobsd') { + return; } if ($config['system']['enableserial']) { return; @@ -1851,23 +1849,16 @@ function mute_kernel_msgs() { } function unmute_kernel_msgs() { - global $config; + global $g; // Do not mute serial console. The kernel gets very very cranky // and will start dishing you cannot control tty errors. - switch (trim(file_get_contents("/etc/platform"))) { - case "nanobsd": - case "jail": - return; + if ($g['platform'] == 'nanobsd') { + return; } exec("/sbin/conscontrol mute off"); } function start_devd() { - global $g; - - if ($g['platform'] == 'jail') { - return; - } /* Use the undocumented -q options of devd to quiet its log spamming */ $_gb = exec("/sbin/devd -q"); sleep(1); diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 21a249e..2820822 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -116,10 +116,6 @@ function vpn_ipsec_convert_to_modp($index) { function vpn_ipsec_configure($restart = false) { global $config, $g, $sa, $sn, $p1_ealgos, $p2_ealgos, $ipsec_idhandling; - if ($g['platform'] == 'jail') { - return; - } - /* get the automatic ping_hosts.sh ready */ unlink_if_exists("{$g['vardb_path']}/ipsecpinghosts"); touch("{$g['vardb_path']}/ipsecpinghosts"); @@ -1365,12 +1361,6 @@ function vpn_ipsec_force_reload($interface = "") { /* master setup for vpn (mpd) */ function vpn_setup() { - global $g; - - if ($g['platform'] == 'jail') { - return; - } - /* start pptpd */ vpn_pptpd_configure(); -- cgit v1.1