Commit Graph
6 Commits
Author SHA1 Message Date
Joachim Nilsson f949017596 logrotate(): Ignore any error from rename(), file may not exist
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-18 22:57:18 +02:00
Joachim Nilsson 5ea1ac7582 Followup to #66: Gzip log files >= .2
This patch to the logrotate() function extends the log rotattion of a
file with a gzip of .2 and older log files.  If gzip is not available
in $PATH then @num files are left uncompressed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 11:00:17 +01:00
Joachim Nilsson bbbaba7b47 Minor cleanup
initctl: Replace daemon-only API from user tool
utmp-api.c: Remove not needed header

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:20:29 +01:00
Joachim Nilsson 0f64e18f27 Relocate utmp_show() to initctl.c
Only used by this tool, no need to keep it in the shared utmp-api.c

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-02-10 10:17:41 +01:00
Joachim Nilsson 9974d65756 Fix #66: Rotate /var/log/wtmp log max:2, size:100k
This patch adds a simple log-rotate function to the UTMP, WTMP, BTMP,
and lastlog files.  Enabled by default, disable with:

    configure --disable-logrotate

Even though it can rotate /run/utmp it is unlikely this file will grow
that much during a system's uptime.

The hard-coded defaults are to keep up to two (2) previous versions
of the files and rotate on file size >= 100k.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-25 19:40:06 +01:00
Joachim Nilsson fff68b7b06 Relocate source files to an src/ subdirectory
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-16 01:31:02 +01:00