summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
Commit message (Collapse)AuthorAgeFilesLines
* Do not :-terminate err(3) string, one will be added anyway.charnier2004-04-041-1/+1
|
* Move newsyslog.conf.5 to usr.sbin/newsyslog. There is no real historytrhodes2004-03-122-1/+371
| | | | | | other than 'initial revision' thus I did not request a repocopy. Requested by: ru, gad
* Remove information about the configuration file.trhodes2004-03-111-308/+3
| | | | Add an Xref to newsyslog.conf.5 and bzip2.1.
* Handle a 'const' parameter without using __DECONST().gad2003-10-041-8/+14
| | | | MFC after: 14 days
* Restructure the time processing routines, mainly to fix up thegad2003-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
* Correct the calculation of "a leap year" in parseDWM. The calculationgad2003-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
* Move the parse8601 and parseDWM routines into a new ptime.c file. Thegad2003-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
* Switch dotrim() to take advantage of the 'struct conf_entry' thatgad2003-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
* Reduce the annoying compiler warnings that pop up when compiling withgad2003-09-091-9/+9
| | | | | | gcc 3.3.x and -Wshadow. Just renames 'log' variables to be 'logname'. MFC after: 22 days
* Correct the comment about which timezone-change loses an hour...gad2003-09-091-2/+2
| | | | MFC after: 23 days
* Add a '-D <something>' command line arg, which can be used to setgad2003-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
* Use strtol() instead of strtoul() in parse8601, so we can detectgad2003-09-091-17/+17
| | | | | | | negative values. Mainly done to sync this routine with OpenBSD. Obtained from: OpenBSD MFC after: 23 days
* Fix typo in the previous commit. Was checking wrong variable...gad2003-09-091-1/+1
| | | | MFC after: 23 days
* Change parse8601 and parseDWM so they return an alternate error valuegad2003-09-091-14/+29
| | | | | | for invalid times, and have the caller print the error message. MFC after: 23 days
* Cosmetic change to move parse8601 right next to parseDWM. No codegad2003-09-091-86/+86
| | | | | | is changed. (that will come in later updates). MFC after: 23 days
* When checking the 'user:group' field in newsyslog.conf, freebsd's sourcegad2003-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
* Fix an 'bad file descriptor' error which would come up when usinggad2003-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
* Fix age_old_log checking so that it will notice log files which weregad2003-05-051-4/+19
| | | | | | | | | | rotated and then compressed with bzip2 instead of gzip. Otherwise, any file which had a time-interval specified for 'when' and also specified the 'J' flag would be rotated every time newsyslog was run. (this is a quick-fix, trying to beat the code-freeze for 5.1-release) PR: bin/51519 MFC after: 1 week
* Slightly improve the checking of the 'size' field, so people will getgad2003-05-051-2/+8
| | | | | | a warning message if they switch the values for 'size' and 'when'. MFC after: 1 week
* Use __FBSDID over rcsid[]. Protect copyright[] where needed.obrien2003-05-031-4/+2
|
* Add a -C (create) option for newsyslog, and a 'C' flag for entries in thegad2003-04-272-20/+190
| | | | | | | | | | config file. If the -C option is specified once, then newsyslog will create any entries which specify the 'C' option. If -C is given twice, then newsyslog will create all missing log files. Some of this code comes from NetBSD, although this implementation does not exactly match theirs. Reviewed by: freebsd-arch MFC after: 10 days
* Document support for the new 'U' flag, which was implemented back in Marchgad2003-04-241-6/+17
| | | | | | as revision 1.64 of newsyslog.c. I plan to MFC these changes next week. MFC after: 1 week
* Document support for the new -s and -R command-line options, andgad2003-04-241-51/+124
| | | | | | | | | | | the 'N' flag. These were coded in March as revisions 1.55 and 1.56 of newsyslog.c. I intend to MFC all the matching changes next week. This also reorganizes the description of the 'flags' field to give list of the valid flags, instead of a long paragraph explaining each of the possible values. Obtained from: NetBSD (in spirit at least, for -s and N) MFC after: 1 week
* Document support for the <default> entry, which was implemented ingad2003-04-231-2/+8
| | | | | | | revision 1.50 of newsyslog.c , back in February. I intend to MFC those changes soon. MFC after: 4 days
* Fix interactions between entries for a specific file vs entries forgad2003-03-091-62/+177
| | | | | | | | | a filename pattern, and also wrt filenames given on the command line. Now if a file is listed as a specific entry, it will not *also* be processed by an entry specifying a pattern. And filename-patterns will now only match existing files (ignoring directories, etc). MFC after: 3 weeks
* The processing of files given on the command-line will work a little bettergad2003-03-091-1/+1
| | | | | | | if we return the entire worklist, instead of just the last entry. A minor fix to revision 1.57. MFC after: 15 days
* Add a config-file flag of 'U' or 'u' to indicate that the pid-filegad2003-03-081-46/+115
| | | | | | | | | | | | | | | will contain the pid for a process group. This means the file must contain a negative value (as would be needed in the 'kill' commmand). I still need to write man-page update before MFC-ing. This started by rewriting the get_pid() routine. Later I looked at what OpenBSD has, and included a few ideas from their send_signal() routine. So, parts of this change are from OpenBSD, even though OpenBSD does not actually have a 'U' flag. PR: bin/28435 Reviewed by: no objections on freebsd-arch MFC after: 3 weeks
* Prefix all -n (noaction) "unix cmds" with tab, thus making it much easiergad2003-03-071-19/+24
| | | | | | | | to sort out noaction messages from -v (verbose) messages. This also improves a few noaction messages. Obtained from: OpenBSD MFC after: 3 weeks
* Move the -s (nosignal) processing, as newsyslog needs to print out agad2003-03-071-11/+14
| | | | | | | | | | warning message if -s is specified and it rotates a file that expects to be compressed. This warning message is not printed if -R is also specified, because we assume a -sR request is coming from the process which would have been signaled, and that it has already released the logfile. Indirectly noticed by: sheldonh
* Add missing 'static' on two routines, so they match their declarations.gad2003-03-031-2/+2
| | | | | | PR: 29363 (a small part of) Submitted by: dinoex MFC after: 3 weeks
* A variety of cosmetic changes, mostly to (slightly) reduce diffs withgad2003-03-031-29/+29
| | | | | | OpenBSD. Except for one added '\n', the object code is not changed. MFC after: 3 weeks
* Collapse two more parameters to dotrim() into the 'ent' parameter that isgad2003-03-031-13/+12
| | | | | | already there. This should not effect anything. MFC after: 3 weeks
* Change to using uid_t and gid_t instead of int. Also change this won'tgad2003-03-031-42/+37
| | | | | | | bother doing a chmod() if neither of these two fields are set. Obtained from: OpenBSD MFC after: 3 weeks
* Fix the interactions between specific log files given on the command line,gad2003-03-031-106/+186
| | | | | | | | | and config-file entries which specify a filename-pattern (glob). It is still not perfectly-right, but at least it isn't completely-wrong. Reviewed by: no objections on freebsd-arch MFC after: 3 weeks MFC addendum: (or after the code-freeze of 4.x is lifted)
* Add a command-line option of '-R somename', which indicates that newsysloggad2003-03-021-9/+77
| | | | | | | | | | | | | should rotate all files given on the command, even if they don't seem to need to be rotated. This would be used by some other command that decides the given log file(s) should be rotated, but wants the "how" of that rotation to be determined by entries to newsyslog. Wes expects to change syslogd to take advantage of this. Man page will be updated after we're sure this is all working the way we want it to. Reviewed by: no objections on freebsd-arch MFC after: 3 weeks MFC addendum: (or after the code-freeze of 4.x is lifted)
* Add a command-line option of '-s', which indicates that newsyslog shouldgad2003-03-021-50/+120
| | | | | | | | | | | | not send a signal to any processes. Also add a config-file flag of 'N' or 'n', which indicates that the given logfile has no process which needs a signal when it is rotated. Both of these are based on changes NetBSD has made, although the implementation is somewhat different. PR: bin/36553 (2nd half) Reviewed by: no objections on freebsd-arch Obtained from: NetBSD (in spirit, at least) MFC after: 3 weeks
* Fix an error which caused 'free(): error: chunk is already free'gad2003-02-261-0/+3
| | | | | | if an entry in the config file included flag 'G'. MFC after: 3 weeks
* Check the value given for number-of-logs to keep in config-file entries,gad2003-02-241-2/+2
| | | | | | | and error-out if the value is negative (avoiding an infinite loop). PR: bin/30654 (part of it) MFC after: 3 weeks
* 1) Fix so -a honors the -n ("do nothing") option. Before, if the directorygad2003-02-241-4/+16
| | | | | | | | | | given for -a did not exist, then newsyslog would always try to create it, even if -n was specified. 2) When -a processing *does* create the directory, have it check the result from mkdir(), and immediately error-out if that failed. PR: bin/46974 MFC after: 3 weeks
* Minor style fix. Add parenthesis around 'return' values.gad2003-02-241-16/+16
| | | | | Reviewed by: md5 MFC after: 3 weeks
* Add the idea of a "default rotate action", which will be used if a file isgad2003-02-241-33/+194
| | | | | | | | | | | specified at runtime, but that filename is not listed in the newsyslog.conf file. This default-action can be changed by having a line in newsyslog.conf with the filename of "<default>". Before this change, the program would quietly ignore the given file. An update to the man page will be written after I finish some other updates to newsyslog.c. Reviewed by: no objections from freebsd-arch MFC after: 3 weeks
* english(4) police.schweikh2002-12-271-2/+2
|
* Make newsyslog(8) print the correct date when the logs are turned over.trhodes2002-12-211-2/+2
| | | | | | PR: 46395 Submitted by: maxim MFC: eventually
* Add a new `W' flag, that when used in conjunction with the `Z' flag or thesobomax2002-12-152-8/+38
| | | | | | | | | | | | | | `J' flag means that newsyslog should wait for previously started compression jobs to complete before starting a new one for this entry. When it is used along with the `G' flag, in the case when several logfiles match the pattern and should be compressed, the newsyslog will compress logs one by one, ensuring that only one compression job is running at a time. This prevents newsyslog(8) from overloading system by starting several compression jobs on big files simultaneously. Sponsored by: Porta Software Ltd MFC after: 2 weeks
* Backout unapproved WARNS level change occasionally slipped into previoussobomax2002-12-111-1/+1
| | | | | | commit. Big pointy hat to: sobomax
* - Allow comments to be placed at the end of configuration line.sobomax2002-12-113-5/+21
| | | | | | Sponsored by: Porta Software Ltd Approved by: re MFC after: 2 weeks
* mdoc(7) police: markup fixes.ru2002-11-271-1/+1
| | | | Approved by: re
* Add a new newsyslog.conf flag - 'G', which if set tells newsyslog(8) thatsobomax2002-11-142-1/+29
| | | | | | | | | | the specified filename of the log to be rotated is in fact shell glob pattern. In this case, all files matching this pattern will be rotated using the same options. Useful in the case when there is no pre-defined name for the logfiles (e.g. xtradius, samba etc). Sponsored by: PortaOne Software Ltd MFC after: 2 weeks
* Fix getopt(3) optstring: remove a flag we does not handle.maxim2002-10-161-1/+1
| | | | | | PR: bin/44066 Submitted by: Stefan Farfeleder <e0026813@stud3.tuwien.ac.at> MFC after: 1 week
* The .Nm utilitycharnier2002-07-141-2/+3
|
OpenPOWER on IntegriCloud