diff options
author | Chris Buechler <cmb@pfsense.org> | 2013-01-20 20:34:54 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2013-01-20 20:34:54 -0800 |
commit | ddabc355c23468f06122ba1f1398be8e2b3cf10e (patch) | |
tree | cd646c3517c589f03cb1325085c201952d9ca1d4 /config/squid/squid.inc | |
parent | 31c3b9fdebbb3c4255c62c411621014f68c144a2 (diff) | |
parent | 7e2a830f799954a4f021bbadfbabe0a6aca2546b (diff) | |
download | pfsense-packages-ddabc355c23468f06122ba1f1398be8e2b3cf10e.tar.gz pfsense-packages-ddabc355c23468f06122ba1f1398be8e2b3cf10e.tar.bz2 pfsense-packages-ddabc355c23468f06122ba1f1398be8e2b3cf10e.zip |
Merge pull request #350 from phil-davis/master
Replace proxy_monitor with sqpmon for squid(2)
Diffstat (limited to 'config/squid/squid.inc')
-rw-r--r-- | config/squid/squid.inc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 30f3884c..54e87c1a 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -219,6 +219,10 @@ function squid_install_command() { exec("chmod a+rx " . SQUID_LOCALBASE . "/libexec/squid/dnsserver"); 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, @@ -230,7 +234,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')) @@ -251,7 +255,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(); @@ -269,8 +273,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"); |