[PATCH]: Syslogd behavior when filesystem is full

From: Rajasekhar Inguva (irajasek@in.ibm.com)
Date: Thu Aug 01 2002 - 10:12:53 CEST

  • Next message: Bruce M Beach: "klogd not working"

    Greetings,

    When syslogd encounters a situation where there is no space left on
       the filesystem for logging, it stops, leaving any partial message
       in the log file. Not only is the last message not fully logged, no
       warning goes in to the log file saying that the filesystem is
       full.

       The situation can be handled as follows..

       1) Remove just enough lines from the beginning of the log file to
          make space for the last message and a warning to indicate the
          "no space" situation.

       2) Remove the partial message if any.

       3) Make sure the file size is greater that the required space.

       4)Write the message completely.

       5) Append a warning message("Syslogd does not have enough space to write
    to
         log file") explaining what happened.

       6) Truncate the file to get rid of any extra space left in the
          file.

       This makes sure that the message that was being logged when the
       file system became full (may probably indicate what caused the
       filesystem to become full) goes in to the log file.

    This patch is created against sysklogd-1.4-7 which comes with RedHat 7.1
    and can be applied by running

    patch -p0 < syslogd-1.4-7_rh7.1.patch

    from the sysklogd-1.4-7 source directory.

    Also, there is a kernel patch available which does the printk on an ENOSPC
    error. This is made against linux-2.4.2-2 which is the kernel version
    in RedHat 7.1. This patch can be applied by running

    patch -p0 < kernel-2.4.2-2-rh7.1.patch

    from the kernel-2.4.2-2 source directory.

    Any comments/Suggestions are welcome.

    Please put me on CC as i am not subscribed to the list.

    Thank you,

    Regards,
    Rajasekhar I

    (See attached file: kernel-2.4.2-2-rh7.1.patch)(See attached file:
    syslogd-1.4-7_rh7.1.patch)






    This archive was generated by hypermail 2.1.4 : Thu Aug 01 2002 - 10:18:19 CEST