[syslog-ng] 2GB log file size restrictions 1.9 tree

Balazs Scheidler bazsi at balabit.hu
Sat Apr 1 10:07:05 CEST 2006


On Wed, 2006-03-29 at 11:15 -0700, William Bell wrote:
> Is there a way to configure this restriction, nothin is mentioned
> about it in the doc's. Up until recently I deployed 1.6 tree across
> all my devices and i never ran into this problem. I just recently
> upgraded to the 1.9 tree and now syslog-ng just crashes when a 2gb
> file is reached. If anyone has ANY ideas there are greatly accepted.

I have just committed a fix for this issue, the next snapshot due this
midnight will contain the fix, or you can use the patch below.

After applying you need to rerun autoconf, configure and rebuild.

--- orig/configure.in
+++ mod/configure.in
@@ -105,6 +105,20 @@ I_CONSLOG
 ],
   blb_cv_c_i_conslog=no, blb_cv_c_i_conslog=yes)])

+old_CPPFLAGS=$CPPFLAGS
+CPPFLAGS=-D_GNU_SOURCE
+AC_CACHE_CHECK(for O_LARGEFILE, blb_cv_c_o_largefile,
+  [AC_EGREP_CPP(O_LARGEFILE,
+[
+#include <fcntl.h>
+O_LARGEFILE
+],
+  blb_cv_c_o_largefile=no, blb_cv_c_o_largefile=yes)])
+CPPFLAGS=$old_CPPFLAGS
+
+if test "x$blb_cv_c_o_largefile" = "xyes"; then
+        AC_DEFINE(HAVE_O_LARGEFILE, 1, [O_LARGEFILE is present])
+fi

 dnl Checks for library functions.
 AC_CHECK_LIB(door, door_create)


--- orig/src/affile.c
+++ mod/src/affile.c
@@ -34,6 +34,10 @@
 #include <errno.h>
 #include <time.h>

+#if !HAVE_O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
 static gboolean
 affile_open_file(gchar *name, int flags,
             int uid, int gid, int mode,
@@ -92,11 +96,9 @@ affile_sd_init(LogPipe *s, GlobalConfig
   int fd, flags;

   if (self->flags & AFFILE_PIPE)
-    flags = O_RDWR | O_NOCTTY | O_NONBLOCK;
+    flags = O_RDWR | O_NOCTTY | O_NONBLOCK | O_LARGEFILE;
   else
-    {
-      flags = O_RDONLY | O_NOCTTY | O_NONBLOCK;
-    }
+    flags = O_RDONLY | O_NOCTTY | O_NONBLOCK | O_LARGEFILE;

   log_reader_options_init(&self->reader_options, cfg);

@@ -189,9 +191,9 @@ affile_dw_init(LogPipe *s, GlobalConfig
               NULL);

   if (self->owner->flags & AFFILE_PIPE)
-    flags = O_RDWR | O_NOCTTY | O_NONBLOCK;
+    flags = O_RDWR | O_NOCTTY | O_NONBLOCK | O_LARGEFILE;
   else
-    flags = O_WRONLY | O_CREAT | O_APPEND | O_NOCTTY | O_NONBLOCK;
+    flags = O_WRONLY | O_CREAT | O_APPEND | O_NOCTTY | O_NONBLOCK | O_LARGEFILE;

   if (affile_open_file(self->filename->str, flags,
                        self->owner->file_uid, self->owner->file_gid, self->owner->file_perm,





-- 
Bazsi



More information about the syslog-ng mailing list