- rotatelog: Factor out from doRotate, main; make error handling consistant
and print the actual error to stderr
PR 45084
Backport of r1374247 from trunk.
- rotatelog: Cleanups, no functional change. Drop revision history,
"svn log" works; use APR_PATH_MAX; constify more
Backport of r1409800 from trunk.
- rotatelog: error[120] is already defined in this function. Just use
it instead of shadowing.
Backport of r1416121 from trunk.
- rotatelog: Use apr_snprintf(... "%pm"...) instead of explicit call
to apr_strerror
Backport of r1463736 from trunk.
- mod_deflate: style fix (no code change)
Backport of r1499679 from trunk.
- mod_socache_shmcb: Correct the use of the printf formatter.
Backport of r1493925 from trunk.
- mod_cache_socache: Fixed signed<->unsigned compiler warning.
Backport of r1490550 from trunk.
- mod_ssl: add missing space between directive description and syntax
Backport of r1509983 from trunk.
- mpm/winnt: style consistency in winnt's worker_main
Backport of r1520760 from trunk.
Proposed by: jailletc36
Reviewed by: jim, rjung
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1528969 13f79535-47bb-0310-9956-ffa450edef68
rotatelogs: add -n number-of-files option to roate through a number
of fixed-name logfiles.
don't truncate the very first file opened (unless the truncate flag is there too)
Submitted by: covener
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1492708 13f79535-47bb-0310-9956-ffa450edef68
Replace use of apr_file_write() with apr_file_write_full() to prevent
incomplete writes.
Add comments in some places where error handling/logging is missing.
PR: 53131.
Submitted by: Nicolas Viennot <apache viennot biz>, Stefan Fritsch
Submitted by: sf
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1430514 13f79535-47bb-0310-9956-ffa450edef68
* support/rotatelogs.c (post_rotate): Really omit the second arg when
invoking a post-rotate program, rather than passing an empty arg.
(Fixes to code match desired&documented behaviour.)
Reviewed by: jorton, jim, sf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1416406 13f79535-47bb-0310-9956-ffa450edef68
where open() fails for a new log file.
* support/rotatelogs.c (struct logfile): New structure.
(struct rotate_status): Store only current logfile state here, using
struct logfile.
(close_logfile): Rename from closeFile; assume a valid logfile
structure is passed in; simplify to use stored filename.
(checkRotate, main): Adjust for new structure.
(post_rotate): Adjust, move linkfile handling here.
(doRotate): Simplify.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1140138 13f79535-47bb-0310-9956-ffa450edef68
new log file is opened as well as for rotations:
* support/rotatelogs.c (usage): Update.
(post_rotate): Omit third arg if no prev logfile known.
(doRotate): Invoke even if no previous logfile was open.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1140099 13f79535-47bb-0310-9956-ffa450edef68
the verbose printf for closing the file never occurred because apr_file_info_get()
always returned APR_INCOMPLETE. Fix that so we still get a printf with the
information we get back.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024359 13f79535-47bb-0310-9956-ffa450edef68
for rotatelogs.
Prefer adding reliable piped logs to the error
loggers in httpd, so that one could simply
kill rotatelogs and httpd automatically starts new
instances of all loggers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@734973 13f79535-47bb-0310-9956-ffa450edef68
- remove 'now' from status struct. We only need it locally.
- add 'static' to function declaration, although the code
is still in a single file
- change signature of get_now()
- make argument count check easier to understand
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733513 13f79535-47bb-0310-9956-ffa450edef68
using HUP and INT signals to the rotatelogs process.
This is helpful, when log activity is low, but you want
rotatelogs to close the open log files.
SIGHUP triggers checking the rules given during startup,
SIGINT forces rotate independently form those rules.
When the signal triggers a rotation, the open file
is closed immediately. The new file is opened when
new log data arrives, or in case "-f" was given it
is opened immediately.
Based on my patch in BZ 44427.
Note on Windows: The new functionality is undefined when
SIGHUP or SIGINT are not available. Does the use case
make sense on Windows? If so, which signals should we use?
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733493 13f79535-47bb-0310-9956-ffa450edef68
of signal triggered log rotation.
- move code into new functions checkRotate() and doRotate()
- bundle config data and runtime data in two structs to
allow easier passing to functions
- Simplify bypass_io logic as a first use case for doRotate
and rename flag to force_open to reflect the new logic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733476 13f79535-47bb-0310-9956-ffa450edef68
when failing to write to the log file.
Sometimes users have a hard time believing that their little log
file was really big enough to reach quota/filesystem/other limit
back at the time of the error.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646845 13f79535-47bb-0310-9956-ffa450edef68
This will not change the logic if no "-l" gets used, and it will spare
one call to apr_time_now() in case "-l" gets used and more important
it gives the code better atomicity, because in fact between the two calls
there is a slight change of jumping oder the DST boundary
- for historic reasons the same code block is used two times with a
slightly different way of transforming apr_time_t to int
(once division by APR_USEC_PER_SEC, once call to apr_time_sec()),
so let's unify it.
- finally move the block into a function, because it gets used already
two times.
PR: 44004
Submitted by: Rainer Jung <rainer.jung kippdata.de>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600154 13f79535-47bb-0310-9956-ffa450edef68
example invocations now flagged as invalid:
specifying UTC offset with size-based rotation
specifying -l with size-based rotation
specifying both -l and UTC offset
range checking of integer parameters not attempted; basic data type issues may need
to be addressed first such as the use of unsigned int for max file size
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@596698 13f79535-47bb-0310-9956-ffa450edef68
in case a switch between standard and daylight savings time
occurred. (correction to previous code courtesy of Uli Zappe.)
PR: 24417
Submitted by: Uli Zappe <uli ritual.org>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103973 13f79535-47bb-0310-9956-ffa450edef68