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

    Many proxy_monitor.sh started from squid.

    Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
    5 Posts 2 Posters 1.4k Views
    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

      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

        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
        • marcellocM
          marcelloc
          last edited by

          @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

            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

              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
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.