ROTATE LOG (SQUID) FAILS AFTER pppoe_restart



  • I am running pfsense 2.1 amd64 with squid3-dev 3.3.10 v 2.2.6 along with sarg 2.3.6_2 v 0.6.3

    my squid configuration is set to rotate logs everyday at midnight and sarg conf is set to rotate logs every 4h….........but that does not work.

    I also have a pppoe_restart cron task which is identified to create this problem

    30 7 * * * root /var/etc/pppoe_restart_pppoe0
    

    this task is scheduled to break and reconnect my pppoe sessions at 7:30 am everyday to achieve higher speed slabs as designated by my ISP.

    After execution of the above pppoe_restart cron job another cron job```
    0 0 * * * root /usr/pbi/squid-amd64/sbin/squid -k rotate -f /usr/pbi/squid-amd64/etc/squid/squid.conf

    To rotate access.log I manually restart squid by```
    /usr/local/etc/rc.d/squid.sh
    ```then then```
    /usr/pbi/squid-amd64/sbin/squid -k rotate  
    ```, **automatic log rotation resumes till the next pppoe_restart after which it again fails.** 
    
    **WITHOUT THE pppoe_restart cron job the squid logs rotate correctly everyday at 00:00 hrs**
    
    syslog output at pppoe_restart @ 7:30 hrs is as below
    

    Jul 13 07:30:51 squid[71404]: Squid Parent: (squid-1) process 71751 started
    Jul 13 07:30:51 squid[71404]: Squid Parent: will start 1 kids
    Jul 13 07:30:48 squid[58906]: Squid Parent: (squid-1) process 59094 exited with status 0
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:44 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:40 squid[58906]: Squid Parent: (squid-1) process 59094 started
    Jul 13 07:30:40 squid[58906]: Squid Parent: will start 1 kids
    Jul 13 07:30:38 squid[52670]: Squid Parent: (squid-1) process 52941 exited with status 0
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:37 php: rc.start_packages: The command '/usr/local/etc/rc.d/cron.sh stop' returned exit code '1', the output was ''
    Jul 13 07:30:37 php: rc.start_packages: Restarting/Starting all packages.
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:33 php: rc.start_packages: [Squid] - Squid_resync function call pr:1 bp:1 rpc:no
    Jul 13 07:30:32 php: rc.newwanip: pfSense package system has detected an ip change 192.168.1.241 -> 192.168.1.241 ... Restarting packages.
    Jul 13 07:30:30 php: rc.newwanip: Creating rrd update script
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:30 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:26 php: rc.start_packages: The command '/usr/local/etc/rc.d/cron.sh stop' returned exit code '1', the output was ''
    Jul 13 07:30:26 php: rc.start_packages: Restarting/Starting all packages.
    Jul 13 07:30:25 php: rc.newwanip: rc.newwanip: on (IP address: 192.168.1.241) (interface: opt2) (real interface: ovpns1).
    Jul 13 07:30:25 php: rc.newwanip: rc.newwanip: Informational is starting ovpns1.
    Jul 13 07:30:24 check_reload_status: Starting packages
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 kernel: Bump sched buckets to 256 (was 0)
    Jul 13 07:30:24 php: rc.newwanip: pfSense package system has detected an ip change 120.60.30.101 -> 120.60.3.168 ... Restarting packages.
    Jul 13 07:30:22 check_reload_status: rc.newwanip starting ovpns1
    Jul 13 07:30:22 kernel: ovpns1: link state changed to UP
    Jul 13 07:30:22 php: rc.newwanip: Creating rrd update script
    Jul 13 07:30:22 check_reload_status: Reloading filter
    Jul 13 07:30:22 kernel: ovpns1: link state changed to DOWN
    Jul 13 07:30:22 php: rc.newwanip: Resyncing OpenVPN instances for interface WAN.
    Jul 13 07:30:16 php: rc.newwanip: phpDynDNS (ppsk.dlinkddns.com): (Success) IP Address Changed Successfully! (120.60.3.168)
    Jul 13 07:30:16 php: rc.newwanip: phpDynDNS: updating cache file /conf/dyndns_wandyndns'ppsk.dlinkddns.com'1.cache: 120.60.3.168
    Jul 13 07:30:13 php: rc.newwanip: phpDynDNS (pfsense.myftp.biz): (Success) DNS hostname update successful.
    Jul 13 07:30:13 php: rc.newwanip: phpDynDNS: updating cache file /conf/dyndns_wannoip-free'pfsense.myftp.biz'0.cache: 120.60.3.168
    Jul 13 07:30:13 php: rc.newwanip: ROUTING: setting default route to 120.60.0.1
    Jul 13 07:30:03 check_reload_status: Rewriting resolv.conf
    Jul 13 07:30:03 php: rc.interfaces_wan_configure: Starting 3gstats.php on device '' for interface 'wan'
    Jul 13 07:30:01 check_reload_status: Configuring interface wan

    
    and my cron_squid_sarg log setting images attached
    
    ![cron_proxy_squid_log_rotate_settings.jpg](/public/_imported_attachments_/1/cron_proxy_squid_log_rotate_settings.jpg)
    ![cron_proxy_squid_log_rotate_settings.jpg_thumb](/public/_imported_attachments_/1/cron_proxy_squid_log_rotate_settings.jpg_thumb)
    ![cron_sarg_log_rotate_settings.jpg](/public/_imported_attachments_/1/cron_sarg_log_rotate_settings.jpg)
    ![cron_sarg_log_rotate_settings.jpg_thumb](/public/_imported_attachments_/1/cron_sarg_log_rotate_settings.jpg_thumb)
    ![cron_settings.jpg](/public/_imported_attachments_/1/cron_settings.jpg)
    ![cron_settings.jpg_thumb](/public/_imported_attachments_/1/cron_settings.jpg_thumb)