summaryrefslogtreecommitdiffstats
path: root/tools/omfile.c
Commit message (Collapse)AuthorAgeFilesLines
* new feature: "." action type added to support writing files to relative pathesRainer Gerhards2010-03-171-1/+2
| | | | (this is primarily meant as a debug aid)
* bugfix: potential problem (loop, abort) when file write error occuredRainer Gerhards2010-03-091-2/+2
| | | | | | | | | | When a write error occured in stream.c, variable iWritten had the error code but this was handled as if it were the actual number of bytes written. That was used in pointer arithmetic later on, and thus could lead to all sorts of problems. However, this could only happen if the error was EINTR or the file in question was a tty. All other cases were handled properly. Now, iWritten is reset to zero in such cases, resulting in proper retries.
* retain old $OMFileFlushOnTXEnd semanticsRainer Gerhards2010-03-091-2/+2
| | | | | required because due to bug the default was actually different than specified (or better said: spec was inconsistent in doc as well).
* bugfix: $omfileFlushOnTXEnd was turned on when set to off and vice versaRainer Gerhards2010-03-091-1/+1
|
* bugfix: potential (but very impropable) segfaults in omfileRainer Gerhards2010-03-021-2/+14
| | | | | | | | | | | | - bugfix: potential segfault in omfile when a dynafile open failed In that case, a partial cache entry was written, and some internal pointers (iCurrElt) not correctly updated. In the next iteration, that could lead to a segfault, especially if iCurrElt then points to the then-partial record. Not very likely, but could happen in practice. - bugfix (theoretical): potential segfault in omfile under low memory condition. This is only a theoretical bug, because it would only happen when strdup() fails to allocate memory - which is highly unlikely and will probably lead to all other sorts of errors.
* make $ActonFileDefaultTemplate available to ompipeRainer Gerhards2010-03-011-9/+9
| | | | | | | | | This was not honored by the new ompipe module, because it is a local file directive (it was applied to pipes as a side-effect of using the same module for pipes and files...). I now made this a global, so that semantics are the same as previously. Not really nice, but probably the best thing to do in the current situation (everything else would involve much more overhead --- leave that for the new config system).
* some code cleanupRainer Gerhards2010-02-281-5/+7
|
* moved pipe code to its own moduleRainer Gerhards2010-02-281-1/+1
| | | | | | | ... based on old omfile. Michael Biebl reported that xconsole seems to have some issues with the new pipe code, so it was best to use the old code for pipes. The optimizations were done to speed up file access, so it doesn't really matter pipes do not receive them.
* bugfix: rsyslog hangs when writing to a named pipe which nobody was reading.Rainer Gerhards2010-01-151-6/+16
| | | | Thanks to Michael Biebl for reporting this bug.
* Merge branch 'v4-stable' into v4-betaRainer Gerhards2009-11-301-1/+1
|\
| * Merge branch 'v3-stable' into v4-stableRainer Gerhards2009-11-301-1/+1
| |\
| | * bugfix: $CreateDirs variable not properly initializedRainer Gerhards2009-11-301-1/+1
| | | | | | | | | | | | default thus was random (but most often "on")
| * | Merge branch 'v3-stable' into betaRainer Gerhards2009-06-181-3/+3
| |\|
| | * some minor bugfixesRainer Gerhards2009-06-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - bugfix: invalid error message issued if $inlcudeConfig was on an empty set of files (e.g. *.conf, where none such files existed) thanks to Michael Biebl for reporting this bug - bugfix: when run in foreground (but not in debug mode), a debug message ("DoDie called") was emitted at shutdown. Removed. thanks to Michael Biebl for reporting this bug - bugfix: some garbagge was emitted to stderr on shutdown. This garbage consisted of file names, which were written during startup (key point: not a pointer error) thanks to Michael Biebl for reporting this bug - bugfix: startup and shutdown message were emitted to stdout thanks to Michael Biebl for reporting this bug
* | | bugfix: named pipes did no longer work (they always got an open error)Rainer Gerhards2009-11-051-2/+5
| | | | | | | | | | | | this was a regression from the omfile rewrite in 4.5.0
* | | bugfix: invalid storage class selected for some size config parameters.Rainer Gerhards2009-10-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This resulted in wrong values. The most prominent victim was the directory creation mode, which was set to zero in some cases. For details, see related blog post: http://blog.gerhards.net/2009/10/another-note-on-hard-to-find-bugs.html This replaces the improper bugfix from two commits ago with a proper one.
* | | DirCreateMode was always zero. work-around now is to do a...Rainer Gerhards2009-10-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one-time write to the mode, then all works. However, if no such write is done, the variable always remains zero. I have used the memory debugger as well as shuffled the code around and used guard variables nothing changed. The problem always moved with the changes I did. So I now consider the one-time write a usable work-around, because it definitely fixes the issue even though it does not explain why it happens.
* | | first shot at asynchronous stream writer with timeout capabilityRainer Gerhards2009-07-061-1/+6
| | | | | | | | | | | | | | | ... seems to work on quick testing, but needs a far more testing and improvement. Good milestone commit.
* | | omfile itself no longer needs zlibRainer Gerhards2009-07-021-4/+0
| | |
* | | switched default to keep in line with traditional syslogd behaviourRainer Gerhards2009-06-191-2/+2
| | |
* | | omfile buffers are now synchronized after inactivityRainer Gerhards2009-06-151-0/+7
| | | | | | | | | | | | | | | | | | This is the first shot at this functionality. Currently, we run off a fixed counter in the rsyslogd mainloop, which needs to be restructured. But this code works, so it is a good time for a commit.
* | | implemented $OMFileFlushOnTXEnd directiveRainer Gerhards2009-06-121-1/+11
| | | | | | | | | | | | plus some cleanup...
* | | re-enabled pipe, tty and console in omfileRainer Gerhards2009-06-121-140/+2
| | | | | | | | | | | | | | | | | | | | | ... by moving code to stream.c. Thanks to the new design, new cases are not really needed, resulting in cleaner code. I also did a cleanup of header file usage as a side-activity.
* | | re-enabled outchannel functionalityRainer Gerhards2009-06-121-72/+19
| | |
* | | improved error handling and added fsync() supportRainer Gerhards2009-06-081-1/+3
| | | | | | | | | | | | | | | | | | ... restoring missing functionality after the restructuring of imfile. As a side-effect, this also lays the foundation for even more reliable queue engine operations (but this is not yet done).
* | | cleanup in preparation of next stepsRainer Gerhards2009-06-051-164/+10
| | | | | | | | | | | | | | | now cleand up omfile and straighted out some things. The only commented-out code left is code that must be moved/merged to the stream class, my next target.
* | | made dynafiles working againRainer Gerhards2009-06-051-75/+73
| | | | | | | | | | | | | | | | | | | | | now only stream class is utilized. ttys, pipes and outchannel functionality is currently disabled. But the testbench worked again. Cleanup needed, will do this with next commit (it may break things and I like to have this milestone here).
* | | added $OMFileIOBufferSize config directive and plumbingRainer Gerhards2009-06-041-62/+52
| | |
* | | modified stream class and omfile to work with itRainer Gerhards2009-06-041-26/+68
| | | | | | | | | | | | now some basic operations are carried out via the stream class.
* | | cleaned up stream class ...Rainer Gerhards2009-06-041-1/+1
| | | | | | | | | | | | | | | | | | ... and also made it callable via an rsyslog interface rather then relying on the OS loader (important if we go for using it inside loadbale modules, which we soon possible will)
* | | reduced max value for $DynaFileCacheSize to 1,000Rainer Gerhards2009-06-041-38/+28
| | | | | | | | | | | | | | | | | | | | | The former maximum of 10,000 really made no sense, even 1,000 is very high, but we like to keep the user in control ;)). Also, some general cleanup was done.
* | | added gzip header to output filesRainer Gerhards2009-06-031-3/+27
| | | | | | | | | | | | so they can now be processed with the "regular" gzip tools
* | | first proof of concept on zipped file writerRainer Gerhards2009-06-031-38/+196
|/ / | | | | | | | | | | This DOES NOT work sufficiently well, I just wanted to verify that zip writing is possible and files are readable. Will be refined soon.
* | Merge branch 'beta'Rainer Gerhards2009-04-161-2/+2
|\|
| * Merge branch 'debian_lenny' into v3-stableRainer Gerhards2009-04-161-2/+2
| | | | | | | | | | Conflicts: ChangeLog
* | added O_CLOEXEC to open() callsRainer Gerhards2009-04-021-6/+6
| | | | | | | | | | | | | | | | to make sure only the minimum number of file handles is left open during a exec call. This is not a 100% solution, as there are also some fopen() calls and, more importantly, file descriptors opened by libraries. But it is better than nothing (and it was quick, at least until we run into platform hell, what we will for sure ;)).
* | fixed some problems with "make check"Demo2009-03-311-2/+1
| | | | | | | | | | interestingly, they manifested on Debian, only, but potentially existed on other platforms, too.
* | Merge branch 'omfile-errHandler'Rainer Gerhards2009-03-241-27/+54
|\ \ | | | | | | | | | | | | Conflicts: ChangeLog
| * | omfile suspend handling for non-dynafiles, also bugfixesRainer Gerhards2009-03-191-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | primarily bugs introduced by recent changes. We now also handle static file names correctly, that was not the case before. We now correctly reset the descriptor in the dynafile cache if somthing goes wrong. Keep in mind that reliablity of output is depending on the reliability of the file system driver (the cifs driver returns OK, but still loses data if it is disconnected for too-long).
| * | omfile bugfixingRainer Gerhards2009-03-181-4/+16
| | | | | | | | | | | | | | | | | | | | | - fixed a bug that caused action retries not to work correctly situation was only cleared by a restart - bugfix: closed dynafile was potentially never written until another dynafile name was generated - potential loss of messages
| * | fixed some message-loss situations when file write failures happenedRainer Gerhards2009-03-171-9/+3
| | |
| * | changed one more status settingRainer Gerhards2009-03-111-1/+1
| | | | | | | | | | | | | | | user feedback indicates it now looks like it is working ;) still some more work needed for a "good" solution
| * | try to make file writer restartable (experimental, untested)Rainer Gerhards2009-03-111-4/+5
| | |
* | | integrated various patches for solarisRainer Gerhards2009-03-051-0/+4
|/ / | | | | | | | | | | | | | | | | Unfortunatley, I do not have the full list of contributors available. The patch set was compiled by Ben Taylor, and I made some further changes to adopt it to the news rsyslog branch. Others provided much of the base work, but I can not find the names of the original authors. If you happen to be one of them, please let me know so that I can give proper credits.
* | Merge branch 'beta'Rainer Gerhards2009-01-271-18/+23
|\| | | | | | | | | Conflicts: tools/omfile.c
| * Merge branch 'debian_lenny' into v3-stableRainer Gerhards2008-12-181-19/+23
| |
* | added configuration directive "HUPisRestart"Rainer Gerhards2008-10-231-37/+65
|/ | | | | ...which enables to configure HUP to be either a full restart or "just" a leightweight way to close open files
* Merge branch 'v3-stable' into betaRainer Gerhards2008-10-091-0/+2
|
* added (internal) error codes to error messagesRainer Gerhards2008-06-271-10/+10
| | | | | Also added redirector to web description of error codes closes bug http://bugzilla.adiscon.com/show_bug.cgi?id=20
* support for different forwarding stream drivers addedRainer Gerhards2008-05-051-2/+1
| | | | they can now be set on an action-by-action basis