summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
Commit message (Collapse)AuthorAgeFilesLines
* Add new modifier - "R", when it is specified the path to pid filesobomax2011-05-142-32/+76
| | | | | | | | | will be considered as a path to a binary or a shell script to be executed after rotation has been completed instead of sending signal to the process id in that file. Sponsored by: Sippy Software, Inc. From the: FreeBSD hacking lounge at BSDCan
* Fix an old bug in newsyslog where we kept one log file more than wassimon2011-04-211-31/+59
| | | | | | | | | | | | | | | requested in newsyslog.conf. This was only the case using the non-time based filenames (.0, .1, .2 etc.). The change also makes newsyslog clean clean up the old extra logfile so users don't end up with a single stale logfile which won't be rotated out. This change also cleans up some code a bit to avoid more copy / paste code and removes some old copy / paste code in the process. PR: bin/76697 MFC after: 2 weeks
* Add an example for the use of the <include> entry to help othersdougb2011-03-261-1/+6
| | | | | | who are as slow as I am. Discussed with: gordon
* Sync manpage's SYNOPSIS with program's usage.ru2011-03-092-5/+4
|
* Make code more friendly to the non-C99 compilers - don't allocatesobomax2011-02-221-4/+8
| | | | | | local variables in the `for' loop declaration. This allows trunk newsyslog.c to be compiled on 7.x. This change should be no-op from the functional POV.
* Use correct alphabetical order for xz(1) in SEE ALSO sectionmm2011-01-312-2/+2
| | | | | | | of newsyslog manpages. Reported by: maxim MFC after: 3 weeks
* Add xz(1) support to newsyslog.mm2011-01-314-99/+136
| | | | | | | Rewrite and simplify logfile compression code. Approved by: gad MFC after: 3 weeks
* Make -S functional.brian2010-12-311-1/+1
| | | | MFC after: 1 week
* Fix a typo in a comment.simon2010-11-211-1/+1
| | | | MFC after: 3 days
* Add a -S switch to override the default syslog pid file. This can be usefulbrian2010-07-233-10/+25
| | | | | | if syslogd's -P switch or a syslogd alternative is being used. MFC after: 3 weeks
* Add support for creating the archived log filenames using a time-stampsimon2010-07-222-16/+267
| | | | | | | | | | | | | | | | | | | instead of the traditional simple counter. Using the time-stamp based file-names, once a log file is archived, it will not change name until it is deleted. This means that many backup systems will only perform one backup of the archived log file, instead for performing a new backup of the logfile upon each logfile rotation. This implementation is separate from the patches in the mentioned PR, as I wasn't aware of the existence of the PR until after I had implemented the same functionality as the patches in the PR provide. Unlike the PR, this new code does honor the 'log count' in newsyslog.conf so old logfiles are deleted. This new code does not currently support never deleting the archived logfiles. PR: bin/29363 MFC after: 3 weeks
* Add file include processing for newsyslog.gordon2010-05-292-19/+116
| | | | | | | | | | | | | Format for the include line in /etc/newsyslog.conf is: <include> /etc/defaults/newsyslog.conf Other notes of interest: Globbing is supported in <include> statements. Properly detect circular include loop dependencies. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after: 2 months
* Convert newsyslog to using queue(3) macros instead of a home rolled version.gordon2010-05-291-113/+71
| | | | | | Reviewed by: gad@ Approved by: wes@ (mentor) MFC after: 2 months
* mdoc: move remaining sections into consistent orderuqs2010-05-131-7/+7
| | | | | | | This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections. Found by: mdocml lint run Reviewed by: ru
* Add a new option, -P, which reverts newsyslog(8) to the old behavior,delphij2010-01-202-5/+13
| | | | | | | | | which stops to proceed further, as it is possible that processes which fails to create PID file get screwed by rotation. Requested by: stas MFC after: 2 weeks X-MFC with: r200806
* The last big commit: let usr.sbin/ use WARNS=6 by default.ed2010-01-021-2/+0
|
* Don't consider non-existence of a PID file an error, we should be abledelphij2009-12-211-1/+12
| | | | | | | | | to proceed anyway as this most likely mean that the process has been terminated. PR: bin/140397 Submitted by: Dan Lukes <dan obluda cz> MFC after: 1 month
* Fix 6-year old cut&paste error. The # could be escaped with '\', notsobomax2008-06-261-2/+2
| | | | | | with '\\'. MFC after: 2 weeks
* Fix two typos.delphij2008-01-301-2/+2
|
* s/effect/affect/remko2007-11-271-2/+2
| | | | | | PR: docs/118266 Submitted by: "Kim Scarborough" <sluggo at unknown dot nu> MFC After: 3 days
* Markup fixes.ru2006-09-291-1/+1
|
* Use same signedness for i and matched_c. This should makedelphij2006-08-171-1/+2
| | | | newsyslog(8) WARNS=6 clean.
* Remove mention of the `W' flag, which has been turned to no-op by thesobomax2006-07-212-18/+1
| | | | | | | neworder change. Keep the option in a config file parser, to not violate POLA. MFC after: 2 weeks
* Remove the last three calls to strncpy(), two of which would havegad2006-06-271-6/+6
| | | | | | been bugs if the source had ever been too big for the destination. MFC after: 3 weeks
* Remove the "oldorder" processing. The "neworder" processing hasgad2006-06-271-250/+16
| | | | | | been the default for two years now, without any problems reported. MFC after: 3 weeks
* Improve error-handling related to the fork() done to compress files aftergad2006-01-201-15/+38
| | | | | | | | they have been rotated. Among other things, use warnx() instead of warn() for some messages where the value if errno is irrelevant to the problem being reported. MFC after: 5 days
* Fix logic error which causes <null> to be printed instead of thesobomax2005-12-011-1/+1
| | | | | | actual file name in error message. MFC After: 2 weeks
* Markup fixes.ru2005-06-141-7/+7
| | | | Approved by: re (blanket)
* Add the -N option to not rotate any files. This is to be used inbrooks2005-03-032-4/+21
| | | | | | | | | | cojunction with -C and is used by /etc/rc.d/newsyslog. I forgot that this was in my perforce tree and not my running system and thus committed a non-working newsyslog script. Reported by: des Pointy hat: brooks
* Add a HISTORY section.trhodes2005-02-241-1/+8
| | | | PR: 75282
* Expand *n't contractions.ru2005-02-131-1/+1
|
* Fixed xrefs.ru2005-01-212-3/+3
|
* Sort sections.ru2005-01-181-7/+7
|
* Because the `permission' field in conf_entry is intended to be used asdelphij2005-01-041-1/+1
| | | | | | | | | | parameter 2 in chmod(2), which is a mode_t (and in turn a __uint_16_t), it's more likely that it should be defined as an unsigned variable. This commit should make newsyslog WARNS=6 clean, but don't bump the knob until I have a universe build. MFC After: 1 month
* Mention "-d directory" in usage().brooks2004-10-061-1/+1
| | | | Pointy hat to: brooks
* Don't prepend the directory specified by -d when the file is a relativebrooks2004-10-051-1/+1
| | | | | path. Doing so makes no sense. I'm not sure allowing relative paths makes sense either, but I'm not going to break that now.
* Add a new -d argument which is used to specify an alternate root for logbrooks2004-10-042-2/+19
| | | | | files similar to DESTDIR in the BSD make process. This only affects log file paths not config file (-f) or archive directory (-a) paths.
* Nothing says that /var/log can't be not a directory but a symbolic linksobomax2004-07-041-2/+2
| | | | | | | to a directory. Therefore, use stat(2) instead of lstat(2) to check if /var/log exists. MFC after: 7 days
* Mechanically kill hard sentence breaks.ru2004-07-021-6/+12
|
* Fix the format-string in a call to err(). It was causing a warning ifgad2004-06-201-1/+1
| | | | compiled on 4.x-stable.
* Fix the check for a "duplicate filename to compress", so that we're checkinggad2004-06-191-1/+1
| | | | | | | | | the *filename* and not the pid_file(!). Stupid brain-fault on my part. This could cause a segfault under -neworder if newsyslog had to rotate multiple files, and later ones had specifed the 'N' flag. Bug first reported by: le MFC after: 3 days
* Assorted markup, grammar, and spelling fixes.ru2004-06-131-96/+80
|
* Switch to using the "neworder" for rotating log files, by default. Thegad2004-06-121-1/+9
| | | | | | | main advantage of this is that daemon's are only signalled once per run, instead of once for each file that is rotated. MFC after: 2 weeks
* Drop the include for <stdint.h>, it was only needed when this wasgad2004-06-071-1/+0
| | | | | | | using __DECONST() for something, and that reference has been removed. Noticed by: Helge Oldach MFC after: 13 days
* Add an "oldorder" option, so that when the default changes to "neworder",gad2004-06-071-0/+8
| | | | | | people have a way to drop back to the previous logic. MFC after: 13 days
* In "neworder" processing, reduce the delay between signals to separategad2004-06-071-10/+38
| | | | | | | | processes, and balance that by adding a 10-second delay after all the processes have been signaled. Also improvement a few messages printed with `-n' or `-v' processing (mostly signal-related messages). MFC after: 13 days
* Major re-ordering of the steps that newsyslog will use when processinggad2004-06-071-0/+425
| | | | | | | | | | | | | | | | | | | | | | | | | files to rotate. The new order will first rotate all files that need to be rotated, and then send a single signal to each process which needs to be signaled, and finally it will compress all the files which were rotated. This means daemons will be signaled once per run of newsyslog, instead of once per file rotated. Also, files will be compressed in order of file-size (smallest to largest). Also, it waits for each file to be completely compressed before starting the next one (effectively as if the 'w' flag is specified for all entries in newsyslog.conf). This avoids the situation of having 10 gzip's going at the same time (each with a log.0 and a log.0.gz file active), and it also means that file attributes can be reliably set on files after they are compressed. NOTE: This commit does define NEWORDER (which you could get rid of if you really don't trust this), but it does not flip the "-D neworder" switch. So, at the moment none of these changes happen unless you request them (perhaps by adding '<debug> neworder' in newsyslog.conf). PR: bin/25070 inspired some parts of this Submitted by: parts from bin/25070 done by Helge Oldach MFC after: 14 days
* A variety of minor changes. Allow users to set a debugging option viagad2004-06-071-67/+120
| | | | | | | | | | | | | | | the newsyslog.conf file. Rename one size-related variable, and move another one from the stack into conf_entry. Add a routine to change file-attributes (chown, chmod, chflags), instead of having several places doing the same sequence of system-calls. A few cosmetic/style changes. These should not effect any users. Most of these probably look pointless, but they are the "insignificant parts" of a much larger update that I'll be committing soon. Doing these as a separate update should make that update easier to read. MFC after: 14 days
* Style-istic fix to a number of #define's that were not followed by a tab...gad2004-06-031-16/+16
| | | | MFC after: 16 days
* Add a 'D' flag that can be specified on entries in newsyslog.conf.gad2004-06-032-1/+41
| | | | | | | | If specified, the matching log files will have the NODUMP flag set on them after they are created. Submitted by: Sean Eric Fagan MFC after: 16 days
OpenPOWER on IntegriCloud