diff options
author | Chris Buechler <cmb@pfsense.org> | 2013-01-06 19:18:19 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2013-01-06 19:18:19 -0800 |
commit | ff8b5325d6c7c97364a6d549871a815445497b70 (patch) | |
tree | 0c079943fd86ccfd90ca41160c742abd05bd56ea /config/squid-reverse/squid.inc | |
parent | e1bea5a33c2eaab8a35c9ee802bf0f19c869c12a (diff) | |
parent | 13b74f83284009f127d0d95ad84babf21a660f07 (diff) | |
download | pfsense-packages-ff8b5325d6c7c97364a6d549871a815445497b70.tar.gz pfsense-packages-ff8b5325d6c7c97364a6d549871a815445497b70.tar.bz2 pfsense-packages-ff8b5325d6c7c97364a6d549871a815445497b70.zip |
Merge pull request #347 from phil-davis/master
Replace proxy_monitor with sqpmon for squid3
Diffstat (limited to 'config/squid-reverse/squid.inc')
-rw-r--r-- | config/squid-reverse/squid.inc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/config/squid-reverse/squid.inc b/config/squid-reverse/squid.inc index 4212861e..941395f6 100644 --- a/config/squid-reverse/squid.inc +++ b/config/squid-reverse/squid.inc @@ -282,6 +282,10 @@ function squid_install_command() { squid_write_rcfile(); if(file_exists("/usr/local/pkg/swapstate_check.php")) exec("/bin/chmod a+x /usr/local/pkg/swapstate_check.php"); + write_rcfile(array( + "file" => "sqp_monitor.sh", + "start" => "/usr/local/pkg/sqpmon.sh &", + "stop" => "ps awux | grep \"sqpmon\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill")); foreach (array( SQUID_CONFBASE, SQUID_ACLDIR, @@ -295,7 +299,7 @@ function squid_install_command() { /* kill any running proxy alarm scripts */ update_status("Checking for running processes... One moment please..."); log_error("Stopping any running proxy monitors"); - mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill"); + mwexec("/usr/local/etc/rc.d/sqp_monitor.sh stop"); sleep(1); if (!file_exists(SQUID_CONFBASE . '/mime.conf') && file_exists(SQUID_CONFBASE . '/mime.conf.default')) @@ -316,7 +320,7 @@ function squid_install_command() { /* restart proxy alarm scripts */ log_error("Starting a proxy monitor script"); - mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh"); + mwexec_bg("/usr/local/etc/rc.d/sqp_monitor.sh start"); update_status("Reconfiguring filter... One moment please..."); filter_configure(); @@ -337,8 +341,8 @@ function squid_deinstall_command() { mwexec('rm -rf $cachedir/swap.state'); mwexec('rm -rf $logdir'); update_status("Finishing package cleanup."); - mwexec('rm -f /usr/local/etc/rc.d/proxy_monitor.sh'); - mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill"); + mwexec("/usr/local/etc/rc.d/sqp_monitor.sh stop"); + mwexec('rm -f /usr/local/etc/rc.d/sqp_monitor.sh'); mwexec("ps awux | grep \"squid\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill"); mwexec("ps awux | grep \"dnsserver\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill"); mwexec("ps awux | grep \"unlinkd\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill"); @@ -1935,4 +1939,4 @@ function squid_do_xmlrpc_sync($sync_to_ip, $username, $password) { } -?>
\ No newline at end of file +?> |