diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2007-02-02 14:52:49 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2007-02-02 14:52:49 +0000 |
commit | c0e9433bc9c62cbb0f3f8807aad7287babb2c334 (patch) | |
tree | 8a82b5bc930d4b12c3834ff955fa49884d83d437 | |
parent | 2278e1922636c8293499ae8a3157af36a7c9d9e2 (diff) |
- enable weekly login accounting if LOGINACCOUNTING is set to 1 in the
environment so that it matches the ROOTBACKUP and CHECKFILESYSTEMS way
of doing things
- make the sort command use "-k" instead of the deprecated "+" option
(idea from mk@)
- rotate /var/log/wtmp every week just after weekly ac(8) completes
ok mk@
-rw-r--r-- | etc/newsyslog.conf | 4 | ||||
-rw-r--r-- | etc/weekly | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/etc/newsyslog.conf b/etc/newsyslog.conf index 436d5d4b1a0..29d6ce780ab 100644 --- a/etc/newsyslog.conf +++ b/etc/newsyslog.conf @@ -1,4 +1,4 @@ -# $OpenBSD: newsyslog.conf,v 1.25 2005/02/07 06:08:10 david Exp $ +# $OpenBSD: newsyslog.conf,v 1.26 2007/02/02 14:52:48 ajacoutot Exp $ # # configuration file for newsyslog # @@ -11,7 +11,7 @@ /var/log/maillog 600 7 * 24 Z /var/log/messages 644 5 30 * Z /var/log/secure 600 7 * 168 Z -/var/log/wtmp 644 7 * 168 ZB +/var/log/wtmp 644 7 * $W6D4 ZB /var/log/xferlog 640 7 250 * Z /var/log/ppp.log 640 7 250 * Z /var/log/pflog 600 3 250 * ZB /var/run/pflogd.pid diff --git a/etc/weekly b/etc/weekly index 78530bbc765..1a0152a0035 100644 --- a/etc/weekly +++ b/etc/weekly @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: weekly,v 1.18 2006/10/26 12:20:55 ajacoutot Exp $ +# $OpenBSD: weekly,v 1.19 2007/02/02 14:52:48 ajacoutot Exp $ # umask 022 @@ -40,6 +40,10 @@ echo "" echo "Rebuilding whatis databases:" makewhatis -# echo "" -# echo "Doing login accounting:" -# ac -p | sort -nr +1 +# If LOGINACCOUNTING is set to 1 in the environment, report user +# accounting information +[ "X$LOGINACCOUNTING" = X1 ] && { + echo "" + echo "Doing login accounting:" + ac -p | sort -nr -k 2 +} |