aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/newsyslog
Commit message (Collapse)AuthorAgeFilesLines
* Markup fixes.Ruslan Ermilov2006-09-291-1/+1
| | | | Notes: svn path=/head/; revision=162806
* Use same signedness for i and matched_c. This should makeXin LI2006-08-171-1/+2
| | | | | | | newsyslog(8) WARNS=6 clean. Notes: svn path=/head/; revision=161412
* Remove mention of the `W' flag, which has been turned to no-op by theMaxim Sobolev2006-07-212-18/+1
| | | | | | | | | | neworder change. Keep the option in a config file parser, to not violate POLA. MFC after: 2 weeks Notes: svn path=/head/; revision=160560
* Remove the last three calls to strncpy(), two of which would haveGarance A Drosehn2006-06-271-6/+6
| | | | | | | | | been bugs if the source had ever been too big for the destination. MFC after: 3 weeks Notes: svn path=/head/; revision=159998
* Remove the "oldorder" processing. The "neworder" processing hasGarance A Drosehn2006-06-271-250/+16
| | | | | | | | | been the default for two years now, without any problems reported. MFC after: 3 weeks Notes: svn path=/head/; revision=159968
* Improve error-handling related to the fork() done to compress files afterGarance A Drosehn2006-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 Notes: svn path=/head/; revision=154566
* Fix logic error which causes <null> to be printed instead of theMaxim Sobolev2005-12-011-1/+1
| | | | | | | | | actual file name in error message. MFC After: 2 weeks Notes: svn path=/head/; revision=152980
* Markup fixes.Ruslan Ermilov2005-06-141-7/+7
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=147377
* Add the -N option to not rotate any files. This is to be used inBrooks Davis2005-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 Notes: svn path=/head/; revision=143106
* Add a HISTORY section.Tom Rhodes2005-02-241-1/+8
| | | | | | | PR: 75282 Notes: svn path=/head/; revision=142365
* Expand *n't contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141846
* Fixed xrefs.Ruslan Ermilov2005-01-212-3/+3
| | | | Notes: svn path=/head/; revision=140566
* Sort sections.Ruslan Ermilov2005-01-181-7/+7
| | | | Notes: svn path=/head/; revision=140442
* Because the `permission' field in conf_entry is intended to be used asXin LI2005-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 Notes: svn path=/head/; revision=139655
* Mention "-d directory" in usage().Brooks Davis2004-10-061-1/+1
| | | | | | | Pointy hat to: brooks Notes: svn path=/head/; revision=136186
* Don't prepend the directory specified by -d when the file is a relativeBrooks Davis2004-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. Notes: svn path=/head/; revision=136174
* Add a new -d argument which is used to specify an alternate root for logBrooks Davis2004-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. Notes: svn path=/head/; revision=136127
* Nothing says that /var/log can't be not a directory but a symbolic linkMaxim Sobolev2004-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 Notes: svn path=/head/; revision=131581
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-6/+12
| | | | Notes: svn path=/head/; revision=131500
* Fix the format-string in a call to err(). It was causing a warning ifGarance A Drosehn2004-06-201-1/+1
| | | | | | | compiled on 4.x-stable. Notes: svn path=/head/; revision=130794
* Fix the check for a "duplicate filename to compress", so that we're checkingGarance A Drosehn2004-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 Notes: svn path=/head/; revision=130707
* Assorted markup, grammar, and spelling fixes.Ruslan Ermilov2004-06-131-96/+80
| | | | Notes: svn path=/head/; revision=130420
* Switch to using the "neworder" for rotating log files, by default. TheGarance A Drosehn2004-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 Notes: svn path=/head/; revision=130385
* Drop the include for <stdint.h>, it was only needed when this wasGarance A Drosehn2004-06-071-1/+0
| | | | | | | | | | using __DECONST() for something, and that reference has been removed. Noticed by: Helge Oldach MFC after: 13 days Notes: svn path=/head/; revision=130214
* Add an "oldorder" option, so that when the default changes to "neworder",Garance A Drosehn2004-06-071-0/+8
| | | | | | | | | people have a way to drop back to the previous logic. MFC after: 13 days Notes: svn path=/head/; revision=130205
* In "neworder" processing, reduce the delay between signals to separateGarance A Drosehn2004-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 Notes: svn path=/head/; revision=130204
* Major re-ordering of the steps that newsyslog will use when processingGarance A Drosehn2004-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 Notes: svn path=/head/; revision=130167
* A variety of minor changes. Allow users to set a debugging option viaGarance A Drosehn2004-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 Notes: svn path=/head/; revision=130165
* Style-istic fix to a number of #define's that were not followed by a tab...Garance A Drosehn2004-06-031-16/+16
| | | | | | | MFC after: 16 days Notes: svn path=/head/; revision=130045
* Add a 'D' flag that can be specified on entries in newsyslog.conf.Garance A Drosehn2004-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 Notes: svn path=/head/; revision=130043
* Change standard processing to use the newer createlog() routineGarance A Drosehn2004-06-031-56/+33
| | | | | | | | | | | that had been written some months ago for other processing. This should get rid of a few subtle situations where an existing log file would not exist (for a short time) while it is being rotated. MFC after: 16 days Notes: svn path=/head/; revision=130038
* Improved versions of the is*ch() and tolowerch() macros that I like to use.Garance A Drosehn2004-06-021-7/+7
| | | | Notes: svn path=/head/; revision=129975
* When rotating some "blah.log" file, make sure that a chmod andGarance A Drosehn2004-06-021-13/+14
| | | | | | | | | | | (if requested) a chown is done on the "blah.log.0" file. PR: bin/67137 Submitted by: jeh MFC after: 10 days Notes: svn path=/head/; revision=129974
* Do not :-terminate err(3) string, one will be added anyway.Philippe Charnier2004-04-041-1/+1
| | | | Notes: svn path=/head/; revision=127858
* Move newsyslog.conf.5 to usr.sbin/newsyslog. There is no real historyTom Rhodes2004-03-122-1/+371
| | | | | | | | | other than 'initial revision' thus I did not request a repocopy. Requested by: ru, gad Notes: svn path=/head/; revision=126878
* Remove information about the configuration file.Tom Rhodes2004-03-111-308/+3
| | | | | | | Add an Xref to newsyslog.conf.5 and bzip2.1. Notes: svn path=/head/; revision=126830
* Handle a 'const' parameter without using __DECONST().Garance A Drosehn2003-10-041-8/+14
| | | | | | | MFC after: 14 days Notes: svn path=/head/; revision=120726
* Restructure the time processing routines, mainly to fix up theGarance A Drosehn2003-09-233-85/+480
| | | | | | | | | | | | | "will trim at" message printed when the user requests '-v'. The previous code would often print the wrong time, such as: On Sept 22, run: newsyslog -nv /var/log/wtmp And see: will trim at Mon Sep 1 05:00:00 2003 correct msg: will trim at Wed Oct 1 05:00:00 2003 MFC after: 20 days Notes: svn path=/head/; revision=120361
* Correct the calculation of "a leap year" in parseDWM. The calculationGarance A Drosehn2003-09-141-17/+43
| | | | | | | | | | | would only match a leap year every 400 years. The parseDWM code first showed up in April 2000, so the first time this bug would cause any confusion is in Feb 2004. MFC after: 18 days Notes: svn path=/head/; revision=120046
* Move the parse8601 and parseDWM routines into a new ptime.c file. TheGarance A Drosehn2003-09-124-219/+320
| | | | | | | | | | only code-change is to add a "next_time" parameter to both routines (and that is not used yet). A later update will make "next_time" more useful. MFC after: 20 days Notes: svn path=/head/; revision=119998
* Switch dotrim() to take advantage of the 'struct conf_entry' thatGarance A Drosehn2003-09-091-33/+36
| | | | | | | | | | is already passed in, instead of having the caller copy values from that struct into additional parameters. MFC after: 22 days Notes: svn path=/head/; revision=119927
* Reduce the annoying compiler warnings that pop up when compiling withGarance A Drosehn2003-09-091-9/+9
| | | | | | | | | gcc 3.3.x and -Wshadow. Just renames 'log' variables to be 'logname'. MFC after: 22 days Notes: svn path=/head/; revision=119926
* Correct the comment about which timezone-change loses an hour...Garance A Drosehn2003-09-091-2/+2
| | | | | | | MFC after: 23 days Notes: svn path=/head/; revision=119905
* Add a '-D <something>' command line arg, which can be used to setGarance A Drosehn2003-09-091-3/+57
| | | | | | | | | | | debugging options. Initial option is '-D TN=<time>', which can be used to see how newsyslog would work if run at the specified time. (time format is ISO 8601, since that is already supported). MFC after: 23 days Notes: svn path=/head/; revision=119904
* Use strtol() instead of strtoul() in parse8601, so we can detectGarance A Drosehn2003-09-091-17/+17
| | | | | | | | | | negative values. Mainly done to sync this routine with OpenBSD. Obtained from: OpenBSD MFC after: 23 days Notes: svn path=/head/; revision=119902
* Fix typo in the previous commit. Was checking wrong variable...Garance A Drosehn2003-09-091-1/+1
| | | | | | | MFC after: 23 days Notes: svn path=/head/; revision=119901
* Change parse8601 and parseDWM so they return an alternate error valueGarance A Drosehn2003-09-091-14/+29
| | | | | | | | | for invalid times, and have the caller print the error message. MFC after: 23 days Notes: svn path=/head/; revision=119899
* Cosmetic change to move parse8601 right next to parseDWM. No codeGarance A Drosehn2003-09-091-86/+86
| | | | | | | | | is changed. (that will come in later updates). MFC after: 23 days Notes: svn path=/head/; revision=119897
* When checking the 'user:group' field in newsyslog.conf, freebsd's sourceGarance A Drosehn2003-08-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | was mistakenly calling the standard isnumber() function to find out if the given 'user' or 'group' were all numeric. This meant that only the first character of the fields were actually checked, so a username of (say) '3com' would look like a number, and thus get mapped to uid=3 (bin) instead of username=3com. This bug was introduced back in freebsd's v1.1. That initial import almost matches netbsd's v1.9, except that an internal isnumber() routine was removed in favor of the standard library version. The thing is, that internal routine was checking the entire string, and not just the first digit. In OpenBSD, isnumber() was eventually renamed to isnumberstr() to make the distinction more obvious, and I'm going to follow that lead. I believe this also happens to remove the last references to isnumber() in the entire freebsd base system. Obtained from: OpenBSD, by a long circuitous route MFC after: 5 days Notes: svn path=/head/; revision=119102
* Fix an 'bad file descriptor' error which would come up when usingGarance A Drosehn2003-08-021-1/+0
| | | | | | | | | | the 'C' flag on an entry that also specifies 'user:group' info. Submitted by: Riccardo Torrini <riccardo@torrini.org> in -current MFC after: 4 days Notes: svn path=/head/; revision=118370