Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d If the accouting file doesn't exist, create it if p...



details:   https://anonhg.NetBSD.org/src/rev/7c8552c8b9cd
branches:  trunk
changeset: 509046:7c8552c8b9cd
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Apr 25 11:48:22 2001 +0000

description:
If the accouting file doesn't exist, create it if possible.
Addresses misc/12735 by Robert Elz.

diffstat:

 etc/rc.d/accounting |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 47cdb1791c5d -r 7c8552c8b9cd etc/rc.d/accounting
--- a/etc/rc.d/accounting       Wed Apr 25 11:25:51 2001 +0000
+++ b/etc/rc.d/accounting       Wed Apr 25 11:48:22 2001 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: accounting,v 1.3 2000/09/19 13:04:38 lukem Exp $
+# $NetBSD: accounting,v 1.4 2001/04/25 11:48:22 jdolecek Exp $
 #
 
 # PROVIDE: accounting
@@ -15,10 +15,12 @@
 
 accounting_start()
 {
-       if [ -f /var/account/acct ]; then
-               echo "Turning on accounting."
-               /usr/sbin/accton /var/account/acct
+       if [ ! -f /var/account/acct ]; then
+               echo "Creating accouting file /var/account/acct"
+               >> /var/account/acct
        fi
+       echo "Turning on accounting."
+       /usr/sbin/accton /var/account/acct
 }
 
 accounting_stop()



Home | Main Index | Thread Index | Old Index