Browse Source

- 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@
OPENBSD_4_1
ajacoutot 17 years ago
parent
commit
024d4091f5
2 changed files with 10 additions and 6 deletions
  1. +2
    -2
      src/etc/newsyslog.conf
  2. +8
    -4
      src/etc/weekly

+ 2
- 2
src/etc/newsyslog.conf View File

@ -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

+ 8
- 4
src/etc/weekly View File

@ -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
}

Loading…
Cancel
Save