summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
Commit message (Collapse)AuthorAgeFilesLines
* newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specifiedvangyzen2016-06-061-7/+9
| | | | | | | | | | | | | | | | | | After going through the signal work list, during which do_sigwork() is called and essentially does nothing because -s and -R were specified on the command line, newsyslog will sleep for 10 seconds as the (verbose) code says: "Pause 10 seconds to allow daemon(s) to close log file(s)". However, the man page verbiage for -R (and -s) seems quite clear that this sleep() is unnecessary because the daemon was expected to have already closed the log file before calling newsyslog. PR: 210020 Submitted by: David A. Bright <david_a_bright@dell.com> MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6727
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-03-101-0/+11
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+11
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | First pass to fix the 'tests' packages.gjb2016-02-021-0/+4
|/ | | | Sponsored by: The FreeBSD Foundation
* newsyslog: treat 'c' flag in the config as 'C'bapt2015-10-311-14/+0
| | | | | | | | | | | | | | When -C was introduced in r114137 the plan was to have -C and -c being used for "create" due to a typo in FreeBSD <= 4.8 a temporary compatibility hack has been added to make -c being like -G aka GLOB and a warning was issued for the user to be aware of the futur change for -c. 12 years later it is more than time to remove that hack and finish the what was intent in r114137 Submitted by: Alexandre Perrin <alex@kaworu.ch> Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4000
* newsyslog.conf: allow to configure the signal using the signal name.bapt2015-10-242-16/+48
| | | | | | | Submitted by: Alexandre Perrin <alex@kaworu.ch> MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D3961
* Fix a ton of speelling errorseadler2015-10-211-1/+1
| | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-2/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Add META_MODE support.sjg2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge from head@274682sjg2014-11-192-3/+4
| |\ | |/ |/|
| * Merge head from 7/28sjg2014-08-191-2/+8
| |\
| * | Updated dependenciessjg2014-05-161-1/+0
| | |
| * | Updated dependenciessjg2014-05-101-0/+2
| | |
| * | Merge from headsjg2014-05-081-1/+1
| |\ \
| * \ \ Merge headsjg2014-04-284-1/+459
| |\ \ \
| * \ \ \ Merge from headsjg2013-09-051-16/+27
| |\ \ \ \
| * \ \ \ \ sync from headsjg2013-04-121-58/+134
| |\ \ \ \ \
| * | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | |
| * | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | |
| * | | | | | Sync with HEAD.obrien2013-02-082-13/+31
| |\ \ \ \ \ \
| | \ \ \ \ \ \
| | \ \ \ \ \ \
| | \ \ \ \ \ \
| | \ \ \ \ \ \
| *---. \ \ \ \ \ \ Sync from headsjg2012-11-043-28/+36
| |\ \ \ \ \ \ \ \ \
| * | | | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | | | | | If we fail to send a signal after rotation, print the pidfile from whichmarkj2014-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the corresponding PID was obtained. PR: 194143 Submitted by: Lyndon Nerenberg <lyndon@orthanc.ca> MFC after: 1 week
* | | | | | | | | | | Make it more explicitly clear that -t will not change filename.bdrewery2014-09-231-1/+2
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days
* | | | | | | | | | - Include /etc/newsyslog.conf.d/* and /usr/local/etc/newsyslog.conf.d/* bybdrewery2014-05-201-2/+8
| |_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default for newsyslog(8). The /usr/local/etc/newsyslog.conf.d will give packages an opportunity to install a default configuration to handle their own log files. MFC after: 2 weeks Relnotes: yes
* | | | | | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | from the latter.
* | | | | | | | Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.jmmv2014-03-163-0/+457
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was originally going to only migrate the usr.sbin tests but, as it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/ so it's better to just also migrate the latter at the same time. The other usr.bin tests will be moved separately. To make these tests work within the test suite, some of them have required changes to prevent modifying the source directory and instead just rely on the current directory for file manipulation.
* | | | | | | | Fix newsyslog(8) to use the size of the file instead of the blocks itbdrewery2014-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | takes on disk, as advertised in newsyslog.conf(5). This fixes newsyslog(8) on ZFS with compression enabled to not have large files compared to the expected rotation size. # grep remotes/messages /etc/newsyslog.conf /var/log/remote/messages root:info 640 5 500 * JC # ls -alh /var/log/remote/messages -rw-r----- 1 root info 3.2M Jan 31 20:02 /var/log/remote/messages # newsyslog -vN|grep remote/messages /var/log/remote/messages <5J>: size (Kb): 464 [500] --> skipping # stat -f "st_size: %z st_blocks: %b" /var/log/remote/messages st_size: 3372627 st_blocks: 928 # zfs get -H compressratio zroot/syslogs zroot/syslogs compressratio 3.77x - With fix: # newsyslog -v | grep remote/messages /var/log/remote/messages <5J>: size (Kb): 3338 [500] --> trimming log.... Approved by: bapt (mentor) PR: docs/150877 Reported by: Joshua Isom <jrisom@gmail.com> MFC after: 2 weeks
* | | | | | | | Initialize the struct tm before handing it to strptime(3).markj2013-11-041-0/+1
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 183550 MFC after: 2 weeks
* | | | | | | Fix -Wunsequencedkientzle2013-06-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: dt71@gmx.com
* | | | | | | We want to stat the archived log file rather than the logfile itself.markj2013-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: bin/179122 Submitted by: Oliver Fromme <olli@secnetix.de> MFC after: 3 days
* | | | | | | Some filesystems (NFS in particular) do not fill out the d_type field whenmarkj2013-05-121-6/+17
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Reported by: jilles Reviewed by: jilles MFC after: 2 weeks
* | | | | | Fix interval-based rotations when the -t flag is used. In this case, findmarkj2013-03-261-58/+134
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the most-recently archived logfile and use its mtime to determine whether or not to rotate, as in the non-timestamped case. Previously we would just try to use the mtime of <logfile>.0, which always results in a rotation since it generally doesn't exist in the -t case. PR: bin/166448 Approved by: emaste (co-mentor) Tested by: Marco Steinbach <coco executive-computing.de> MFC after: 2 weeks
* | | | | Rename the run_cmd field to sw_runcmd to make it consistent with themarkj2013-01-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other fields in struct sigwork_entry. Approved by: rstone (co-mentor) MFC after: 1 week
* | | | | Ensure that newsyslog -n prints the correct message for a rotation rulemarkj2013-01-271-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that uses the 'R' flag. Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week
* | | | | When the 'R' flag is used with a newsyslog.conf entry, some fields ofmarkj2013-01-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the corresponding struct sigwork_entry were left uninitialized, potentially causing an early return from do_sigwork(). Ensure that these fields are initialized, and handle the 'R' flag properly in do_sigwork(). PR: bin/175330 Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week
* | | | | Make sure to update the mtime of a logfile after archiving it. Thismarkj2013-01-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensures that the next rotation happens at the correct time when using interval-based rotations. PR: bin/174438 Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week
* | | | | Have -n imply -r, since dry-run mode obviously doesn't require rootmarkj2013-01-032-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | privileges. Approved by: rstone (co-mentor) MFC after: 1 week
* | | | | Fix a typo in an error message.markj2013-01-031-1/+1
| |/ / / |/| | | | | | | | | | | | | | | Approved by: rstone (co-mentor) MFC after: 1 week
* | | | More -Wmissing-variable-declarations fixes.ed2012-10-201-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
* | | | We don't need to check the result of sending signal when -R option isae2012-07-091-1/+2
| |/ / |/| | | | | | | | | | | | | | | | | specified. Submitted by: Ilya A. Arkhipov MFC after: 1 week
* | | mdoc: fix mandoc "Oc breaks Op" warning.joel2012-06-091-5/+10
| |/ |/|
* | Minor spelling fixes.joel2012-06-031-1/+1
|/
* Hide DIR definition by making it an opaque struct typedef.gleb2012-05-191-3/+3
| | | | | | | | | | Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011
* Remove trailing whitespace per mdoc lint warningeadler2012-03-291-1/+1
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Fix a sentence in a paragraph that describes time and interval basedglebius2012-03-211-2/+2
| | | | | trimming. This sentence vaguely can be interpreted as if it was speaking about time and size interaction, while it wasn't about it.
* Don't run through time checks when entry is definitely oversized. Thisglebius2012-03-211-2/+5
| | | | | | leads to newsyslog rotating on (size OR time) if both are specified. PR: 100018, 160432
* Further fix a typo and spelling classic correctly in function names,uqs2012-01-051-8/+8
| | | | | | too. Submitted by: Ben Kaduk <minimarmot@gmail.com>
OpenPOWER on IntegriCloud