• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Many proxy_monitor.sh started from squid.

2.1 Snapshot Feedback and Problems - RETIRED
2
5
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    podilarius
    last edited by Jul 28, 2012, 2:18 PM

    It looks like every time the squid service is restarted another prooxy_monitor.sh is started. This includes IP address changes (or detected change from a PPPoE reconnect). This is wasting my CPU and memory, not to mention that each time this happens, each script that is running reloads my filter.

    1 Reply Last reply Reply Quote 0
    • P
      podilarius
      last edited by Jul 30, 2012, 4:59 PM Jul 30, 2012, 4:52 PM

      Can we just add

      
      IS_RUNNING=`ps awx |grep -c "[p]roxy_monitor.sh"`
      if [ $IS_RUNNING -gt 0 ]; then
              exit 0
      fi
      
      

      Just under the comments and above "set -e" so that if proxy_monitor.sh is already running, we don't start is again and again and again …

      Please?

      Edit: I sent a pull request for this file change. Please review and commit if that works for you guys.

      1 Reply Last reply Reply Quote 0
      • M
        marcelloc
        last edited by Jul 30, 2012, 6:43 PM

        @podilarius:

        Edit: I sent a pull request for this file change. Please review and commit if that works for you guys.

        Merged. Thanks for your feedback.

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • P
          podilarius
          last edited by Jul 31, 2012, 3:24 AM

          Pasted the wrong if comparison. Submitted pull request to fix that. Sorry about that.

          1 Reply Last reply Reply Quote 0
          • P
            podilarius
            last edited by Jul 31, 2012, 6:19 AM

            Just posted another pull request. Sorry about that, it was working until reboot. For some reason (beyond my understanding) when the script starts and I see how many proxy_monitor.sh scripts are running, it shows 2. If I see what is there manually a sec later, it shows 1. Since the variable is already loaded with 2, the script exits out. It might have something to do with the way it is being called from squid reload/load with the mwexec_bg. I am not sure on that entirely though.

            I modified the code to match the way the script is being called. The result is  only one infinite loop running in the background.

            1 Reply Last reply Reply Quote 0
            1 out of 5
            • First post
              1/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.