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

    Squid3 0.3.9.2 Log Rotate Problem

    Scheduled Pinned Locked Moved Cache/Proxy
    10 Posts 2 Posters 2.3k 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.
    • V
      voxeljorz
      last edited by

      Hi everyone, I just have encountered this problem after upgrading squid.

      My squid logs were gone the next day everyday. I have discovered this when I generate Proxy/SARG report the for the previous day and it returns no log.

      Upon check the System Log, I have found this log:

      "php-fpm[69472]: /rc.start_packages: Checked cron job for /usr/pbi/squid-amd64/sbin/squid -k rotate -f /usr/pbi/squid-amd64/local/etc/squid/squid.conf, no change needed"

      I checked the Cron Jobs and I found this (This cron job was automatically added when you install squid.):

      0  0  * *  *  root  /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate

      Log rotation was empty in Squid.
      Log rotation in SquidGuard was unchecked.
      SARG schedules for Daily, Yesterday, Weekly Action - After Sarg were set to None (Default)
      SARG schedules for Monthly - Action After Sarg were set to Rotate Logs.

      I did the workaround, edited the cron to this:
      *0  0  /30  *  *  root  /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        No it wasn't installed with 0.3.9.2. Remove the nonsense from your cron with the Cron package. There is no such feature any more in the Squid3 package. What you posted is some leftover from before 0.3.6 or so.

        0.4.0 will have a (non-configurable) swapstate_check.php cronjob that will run daily, it will do nothing though unless your drive is almost full or your swap.state is ungodly large.)

        1 Reply Last reply Reply Quote 0
        • V
          voxeljorz
          last edited by

          Thank you doktornotor for the reply.

          1 Reply Last reply Reply Quote 0
          • V
            voxeljorz
            last edited by

            By the way I have found this in squid.inc
            */ Handle cronjob install/uninstall */
            function squid_install_cron($should_install) {
            if (platform_booting()) {
            return;
            }

            $cron_cmd = SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE;
            if (($should_install) && (squid_enabled())) {
            install_cron_job("{$cron_cmd}", $should_install, "0", "0", "", "", "*", "root");
            } else {
            install_cron_job("{$cron_cmd}", false);
            }
            }**

            ???

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              As you can notice there, that's a completely different command.

              1 Reply Last reply Reply Quote 0
              • V
                voxeljorz
                last edited by

                Is it that this line add the job to cron?

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  You should not be adding anything anywhere manually. Remove the leftover

                  
                  /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate
                  
                  

                  cronjob and move on.

                  1 Reply Last reply Reply Quote 0
                  • V
                    voxeljorz
                    last edited by

                    Sorry, but I have never added it manually. Actually I have deleted the cron job which I've seen present after the upgrading to Squid3 0.4.0 package.

                    I don't know why.

                    1 Reply Last reply Reply Quote 0
                    • D
                      doktornotor Banned
                      last edited by

                      I have already told you 3 times that it's a leftover from Squid3 before 0.3.6. Remove it and move on.

                      1 Reply Last reply Reply Quote 0
                      • V
                        voxeljorz
                        last edited by

                        @doktornotor:

                        I have already told you 3 times that it's a leftover from Squid3 before 0.3.6. Remove it and move on.

                        I always did. Thanks.

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