Navigation

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

    How to empty a logfile

    General pfSense Questions
    2
    4
    1682
    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.
    • Y
      yoogie last edited by

      Hi there.

      I have the following setup: Captiveportal, transparent squid and of course pfSense V.1.1.0

      I have a small perlscript running on that pfSense which is executed once a day through ssh2. What it does: It prints out the squid-log, the portalauthd.log and the dhcpd.log and should wipe the logfiles by simply doing the following:

      
      if (open (OUT, ">/var/log/dhcpd.log")) {
         close OUT;
      }
      
      

      This ensures a clean and blank logfile without a change in the inode or filehandles.

      This works very well for the squid-logfile, but the dhcpd.log and portalauthd.log files seem to be binary blasted until 65.535 Bytes. Doing the described procedure on those files ends up in a Segmentation fault.

      So, is there a command I can execute to empty those files or how can I achieve that those files get initialized?

      Other question. Is there a sort of logfile rotation? Is it possible to run out of disk space?

      Many thanks in advance.

      CHeers,
      Manuel

      1 Reply Last reply Reply Quote 0
      • Y
        yoogie last edited by

        Hi there, I have found the command.

        
        /usr/sbin/clog -i -s 262144 /var/log/dhcpd.log
        
        

        Am I right that the logfile is like a FILO buffer of a fixed size?
        How can I turn this off?

        Cheers,
        Manuel

        1 Reply Last reply Reply Quote 0
        • S
          sullrich last edited by

          Yes its a fixed size (clog).  It cannot be turned off.

          1 Reply Last reply Reply Quote 0
          • Y
            yoogie last edited by

            Ok, thanks.

            Cheers,
            Manuel

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Products

            • Platform Overview
            • TNSR
            • pfSense
            • Appliances

            Services

            • Training
            • Professional Services

            Support

            • Subscription Plans
            • Contact Support
            • Product Lifecycle
            • Documentation

            News

            • Media Coverage
            • Press
            • Events

            Resources

            • Blog
            • FAQ
            • Find a Partner
            • Resource Library
            • Security Information

            Company

            • About Us
            • Careers
            • Partners
            • Contact Us
            • Legal
            Our Mission

            We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

            Subscribe to our Newsletter

            Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

            © 2021 Rubicon Communications, LLC | Privacy Policy