diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2014-02-18 19:56:22 +0100 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2014-02-18 19:56:22 +0100 |
commit | 74e72fde07380105b8109e94afded71a5ca1338f (patch) | |
tree | 41c7b27ac9621b110a49316b573566c9dcb4cb14 /config | |
parent | 048bb82a0e2c814da90816657ecedf59fedf8dbd (diff) | |
download | pfsense-packages-74e72fde07380105b8109e94afded71a5ca1338f.tar.gz pfsense-packages-74e72fde07380105b8109e94afded71a5ca1338f.tar.bz2 pfsense-packages-74e72fde07380105b8109e94afded71a5ca1338f.zip |
haproxy-devel, extra installation/deinstallation logging to diagnose issues when the process 'hangs'
Diffstat (limited to 'config')
-rw-r--r-- | config/haproxy-devel/haproxy.inc | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index d039b55a..e58187c0 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -159,25 +159,49 @@ $a_sticky_type['stick_rdp_cookie'] = array('name' => 'Stick on RDP-cookie', 'cookiedescr' => 'EXAMPLE: msts or mstshash'); function haproxy_custom_php_deinstall_command() { + global $static_output; + $static_output .= "HAProxy, running haproxy_custom_php_deinstall_command()\n"; + update_output_window($static_output); + $static_output .= "HAProxy, deleting haproxy package\n"; + update_output_window($static_output); exec("cd /var/db/pkg && pkg_delete `ls | grep haproxy`"); + $static_output .= "HAProxy, deleting haproxy webgui\n"; + update_output_window($static_output); exec("rm /usr/local/pkg/haproxy*"); exec("rm /usr/local/www/haproxy*"); exec("rm /usr/local/etc/rc.d/haproxy.sh"); exec("rm /etc/devd/haproxy.conf"); + $static_output .= "HAProxy, running /etc/rc.d/devd restart\n"; + update_output_window($static_output); exec("/etc/rc.d/devd restart"); + $static_output .= "HAProxy, installing cron job if needed\n"; + update_output_window($static_output); haproxy_install_cron(false); + $static_output .= "HAProxy, running haproxy_custom_php_deinstall_command() DONE\n"; + update_output_window($static_output); } function haproxy_custom_php_install_command() { - global $g, $config; + global $g, $config, $static_output; + $static_output .= "HAProxy, running haproxy_custom_php_install_command()\n"; + update_output_window($static_output); + + $static_output .= "HAProxy, conf_mount_rw\n"; + update_output_window($static_output); conf_mount_rw(); + + $freebsd_version = substr(trim(php_uname("r")), 0, 1); - $freebsd_version = substr(trim(`uname -r`), 0, 1); if(!file_exists("/usr/bin/limits")) { + $static_output .= "HAProxy, downloading 'limits'\n"; + update_output_window($static_output); + exec("fetch -q -o /usr/bin/limits http://files.pfsense.org/extras/{$freebsd_version}/limits"); exec("chmod a+rx /usr/bin/limits"); } + $static_output .= "HAProxy, create '/usr/local/etc/rc.d/haproxy.sh'\n"; + update_output_window($static_output); $haproxy = <<<EOD #!/bin/sh @@ -241,6 +265,8 @@ EOD; fclose($fd); exec("chmod a+rx /usr/local/etc/rc.d/haproxy.sh"); + $static_output .= "HAProxy, create '/etc/devd/haproxy.conf'\n"; + update_output_window($static_output); $devd = <<<EOD notify 0 { match "system" "IFNET"; @@ -260,8 +286,13 @@ EOD; $fd = fopen("/etc/devd/haproxy.conf", "w"); fwrite($fd, $devd); fclose($fd); + $static_output .= "HAProxy, running: /etc/rc.d/devd restart \n"; + update_output_window($static_output); exec("/etc/rc.d/devd restart"); + $static_output .= "HAProxy, update configuration\n"; + update_output_window($static_output); + $writeconfigupdate = false; /* Do XML upgrade from haproxy 0.31 to haproxy-dev */ if (is_array($config['installedpackages']['haproxy']['ha_servers'])) { @@ -353,12 +384,22 @@ EOD; } } } - if ($writeconfigupdate) - write_config("haproxy, update xml config version"); + if ($writeconfigupdate) { + $static_output .= "HAProxy, write updated config\n"; + update_output_window($static_output); + write_config("HAProxy, update xml config version"); + } + $static_output .= "HAProxy, conf_mount_ro\n"; + update_output_window($static_output); conf_mount_ro(); + $static_output .= "HAProxy, calling: haproxy.sh start\n"; + update_output_window($static_output); exec("/usr/local/etc/rc.d/haproxy.sh start"); + + $static_output .= "HAProxy, running haproxy_custom_php_install_command() DONE\n"; + update_output_window($static_output); } function haproxy_install_cron($should_install) { |