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

    Squid3 reverse squid and squid in Ethiopia, please help rename proxy_monitor.sh

    Scheduled Pinned Locked Moved pfSense Packages
    11 Posts 3 Posters 2.5k 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.
    • D
      debremarkos
      last edited by

      I am using pfsense in Ethiopia and it all works really well over here apart from when I try and install squid or squid3 packages.
      it gets to the proxy_monitor.sh then fails.
      The reason why it fails is that here in Ethiopia the word proxy is blocked.
      I have gor around the issue by installing a local repository and manually editing the squid.xml so it picks up the from a local source.

      If anyone would be so kind to rename this script to anything that does not contain the word proxy in this would be a life saver as I am training people here on how to use/install pfsense and the work roud solution requires an extra computer and other stuff that is difficult to get over here.

      Many thanks in advance for any help given

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        Seems easy to implement a name change, and it is nice to help out people from countries that put weird internet controls in place.
        There is already a squid_monitor.php, so it might be a little confusing to also have squid_monitor.sh, also there are some grep lines of code that look for the strings "squid" and "proxy_monitor" and find matching processes to kill. Having a process called "squid_monitor" would result in it matching a simple grep for "squid". So it would be best not to have the string "squid" in the name (saves having to mess with making those grep pipelines use better string matching patterns).
        sqp_monitor.sh (SQuid Proxy monitor) would make a unique name for matching.
        I am happy to do the search/replace through the code - should not take long.
        Marcello - as package maintainer, what do you think?

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • marcellocM
          marcelloc
          last edited by

          you mean just rename files with proxy to squid? eg:proxy_monitor.sh files to squid_monitor.sh ???

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

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • P
            phil.davis
            last edited by

            Yes, but having a process called squid_monitor will be a problem - some "grep" commands that currently look for processes that match anything that starts with "squid" might also kill "squid_monitor". So I suggest rename proxy_monitor.sh to sqp_monitor.sh, and make the necessary find/replace everywhere that refers to proxy_monitor.
            Actually, there are only a couple of files to change - I'll make a pull request for squid-reverse and you can look and see what you think.

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

            1 Reply Last reply Reply Quote 0
            • P
              phil.davis
              last edited by

              @marcelloc - I just submitted a new pull request for squid-reverse (=squid3 package).
              There is a small issue with the way proxy_monitor.sh is setup at present. It gets put in /usr/local/etc/rc.d - that dir is for *.sh scripts that are intended to be called to start/stop packages (services) with the parameter "start" or "stop". Currently, rc.start_packages and rc.stop_packages are calling "proxy_monitor.sh start", "proxy_monitor.sh stop".
              proxy_monitor.sh does have code to avoid running twice, which avoids direct problems with these start/stop calls. However:
              a) If proxy_monitor.sh is not already running, then a call like "proxy_monitor.sh start" or "proxy_monitor.sh stop" will actually cause proxy_monitor.sh to run "normally", i.e. in its "do forever" monitoring loop. It would never return to the caller. This could result in rc.stop_packages effectively "hanging" and thus the system not shutting down.
              b) There is also the possibility that rc.start_packages might end up in this condition also at boot time, and the console login menu would never get displayed.
              It seems much safer to make the squid proxy monitor script be in /usr/local/pkg along with the other various bits of squid code. The squid_install_command() function then calls write_rcfile() to generate a proper start/stop script in /usr/local/etc/rc.d
              Now rc.start_packages and rc.stop_packages will start and stop the squid proxy monitor at the necessary times.
              The new monitor sript is called sqpmon.sh
              The start/stop file is called sqp_monitor.sh
              I hope this all makes sense - it resolves these issues as well as fixing the naming problem that debremarkos has.

              As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
              If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

              1 Reply Last reply Reply Quote 0
              • marcellocM
                marcelloc
                last edited by

                Did you tested install, restart and reboot process?

                This code was from squid2, I've changed swap file size check.

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

                Help a community developer! ;D

                1 Reply Last reply Reply Quote 0
                • P
                  phil.davis
                  last edited by

                  The changes in my pull request were all for files in the squid-reverse folder (which is squid3 package) - https://github.com/bsdperimeter/pfsense-packages/tree/master/config/squid-reverse - cmb committed it a few hours ago.
                  The 1st 4 files in the folder are the new/changed ones.
                  I have done a squid3 install and have squid and sqpmon processes running, rebooted to test startup and it starts fine.
                  There should not be anything changed in squid(2).
                  @debremarkos - please try a squid3 install from Ethiopia and tell us how it goes.

                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                  1 Reply Last reply Reply Quote 0
                  • marcellocM
                    marcelloc
                    last edited by

                    thanks phil.davis!  :)

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

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • D
                      debremarkos
                      last edited by

                      will try the squid 3 package now, sorry for the late reply we have been having some power issues over here (ie we have had none)
                      Will let you know the results.

                      Thank you Marcelloc and Phil for your help it is really appreciated.

                      1 Reply Last reply Reply Quote 0
                      • P
                        phil.davis
                        last edited by

                        Look forward to hearing how it goes. I understand the power issues, in Nepal we have places with up to 18-hours load-shedding each day (power on for 2 * 3-hour blocks). It makes low-power computing devices and solar panels very useful!

                        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                        1 Reply Last reply Reply Quote 0
                        • D
                          debremarkos
                          last edited by

                          Phil, just tested and package installed like a DREAM!

                          Thanks so much for this , Pfsense is used in so many universities here and this will mean these universities no longer have to fear a reinstall of pfsense (from a backup that includes the squid3 packages).

                          Many many thanks

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