head 1.9; access; symbols netbsd-10-0-RELEASE:1.9 netbsd-10-0-RC6:1.9 netbsd-10-0-RC5:1.9 netbsd-10-0-RC4:1.9 netbsd-10-0-RC3:1.9 netbsd-10-0-RC2:1.9 netbsd-10-0-RC1:1.9 netbsd-10:1.9.0.96 netbsd-10-base:1.9 netbsd-9-3-RELEASE:1.9 cjep_sun2x-base1:1.9 cjep_sun2x:1.9.0.94 cjep_sun2x-base:1.9 cjep_staticlib_x-base1:1.9 netbsd-9-2-RELEASE:1.9 cjep_staticlib_x:1.9.0.92 cjep_staticlib_x-base:1.9 netbsd-9-1-RELEASE:1.9 phil-wifi-20200421:1.9 phil-wifi-20200411:1.9 is-mlppp:1.9.0.90 is-mlppp-base:1.9 phil-wifi-20200406:1.9 netbsd-8-2-RELEASE:1.9 netbsd-9-0-RELEASE:1.9 netbsd-9-0-RC2:1.9 netbsd-9-0-RC1:1.9 phil-wifi-20191119:1.9 netbsd-9:1.9.0.88 netbsd-9-base:1.9 phil-wifi-20190609:1.9 netbsd-8-1-RELEASE:1.9 netbsd-8-1-RC1:1.9 pgoyette-compat-merge-20190127:1.9 pgoyette-compat-20190127:1.9 pgoyette-compat-20190118:1.9 pgoyette-compat-1226:1.9 pgoyette-compat-1126:1.9 pgoyette-compat-1020:1.9 pgoyette-compat-0930:1.9 pgoyette-compat-0906:1.9 netbsd-7-2-RELEASE:1.9 pgoyette-compat-0728:1.9 netbsd-8-0-RELEASE:1.9 phil-wifi:1.9.0.86 phil-wifi-base:1.9 pgoyette-compat-0625:1.9 netbsd-8-0-RC2:1.9 pgoyette-compat-0521:1.9 pgoyette-compat-0502:1.9 pgoyette-compat-0422:1.9 netbsd-8-0-RC1:1.9 pgoyette-compat-0415:1.9 pgoyette-compat-0407:1.9 pgoyette-compat-0330:1.9 pgoyette-compat-0322:1.9 pgoyette-compat-0315:1.9 netbsd-7-1-2-RELEASE:1.9 pgoyette-compat:1.9.0.84 pgoyette-compat-base:1.9 netbsd-7-1-1-RELEASE:1.9 matt-nb8-mediatek:1.9.0.82 matt-nb8-mediatek-base:1.9 perseant-stdc-iso10646:1.9.0.80 perseant-stdc-iso10646-base:1.9 netbsd-8:1.9.0.78 netbsd-8-base:1.9 prg-localcount2-base3:1.9 prg-localcount2-base2:1.9 prg-localcount2-base1:1.9 prg-localcount2:1.9.0.76 prg-localcount2-base:1.9 pgoyette-localcount-20170426:1.9 bouyer-socketcan-base1:1.9 pgoyette-localcount-20170320:1.9 netbsd-7-1:1.9.0.74 netbsd-7-1-RELEASE:1.9 netbsd-7-1-RC2:1.9 netbsd-7-nhusb-base-20170116:1.9 bouyer-socketcan:1.9.0.72 bouyer-socketcan-base:1.9 pgoyette-localcount-20170107:1.9 netbsd-7-1-RC1:1.9 pgoyette-localcount-20161104:1.9 netbsd-7-0-2-RELEASE:1.9 localcount-20160914:1.9 netbsd-7-nhusb:1.9.0.70 netbsd-7-nhusb-base:1.9 pgoyette-localcount-20160806:1.9 pgoyette-localcount-20160726:1.9 pgoyette-localcount:1.9.0.68 pgoyette-localcount-base:1.9 netbsd-7-0-1-RELEASE:1.9 netbsd-7-0:1.9.0.66 netbsd-7-0-RELEASE:1.9 netbsd-7-0-RC3:1.9 netbsd-7-0-RC2:1.9 netbsd-7-0-RC1:1.9 netbsd-5-2-3-RELEASE:1.9 netbsd-5-1-5-RELEASE:1.9 netbsd-6-0-6-RELEASE:1.9 netbsd-6-1-5-RELEASE:1.9 netbsd-7:1.9.0.64 netbsd-7-base:1.9 yamt-pagecache-base9:1.9 yamt-pagecache-tag8:1.9 netbsd-6-1-4-RELEASE:1.9 netbsd-6-0-5-RELEASE:1.9 tls-earlyentropy:1.9.0.62 tls-earlyentropy-base:1.9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.9 riastradh-drm2-base3:1.9 netbsd-6-1-3-RELEASE:1.9 netbsd-6-0-4-RELEASE:1.9 netbsd-5-2-2-RELEASE:1.9 netbsd-5-1-4-RELEASE:1.9 netbsd-6-1-2-RELEASE:1.9 netbsd-6-0-3-RELEASE:1.9 netbsd-5-2-1-RELEASE:1.9 netbsd-5-1-3-RELEASE:1.9 netbsd-6-1-1-RELEASE:1.9 riastradh-drm2-base2:1.9 riastradh-drm2-base1:1.9 riastradh-drm2:1.9.0.54 riastradh-drm2-base:1.9 netbsd-6-1:1.9.0.60 netbsd-6-0-2-RELEASE:1.9 netbsd-6-1-RELEASE:1.9 khorben-n900:1.9.0.58 netbsd-6-1-RC4:1.9 netbsd-6-1-RC3:1.9 agc-symver:1.9.0.56 agc-symver-base:1.9 netbsd-6-1-RC2:1.9 netbsd-6-1-RC1:1.9 yamt-pagecache-base8:1.9 netbsd-5-2:1.9.0.52 netbsd-6-0-1-RELEASE:1.9 yamt-pagecache-base7:1.9 netbsd-5-2-RELEASE:1.9 netbsd-5-2-RC1:1.9 matt-nb6-plus-nbase:1.9 yamt-pagecache-base6:1.9 netbsd-6-0:1.9.0.50 netbsd-6-0-RELEASE:1.9 netbsd-6-0-RC2:1.9 tls-maxphys:1.9.0.48 tls-maxphys-base:1.9 matt-nb6-plus:1.9.0.46 matt-nb6-plus-base:1.9 netbsd-6-0-RC1:1.9 yamt-pagecache-base5:1.9 yamt-pagecache-base4:1.9 netbsd-6:1.9.0.44 netbsd-6-base:1.9 netbsd-5-1-2-RELEASE:1.9 netbsd-5-1-1-RELEASE:1.9 yamt-pagecache-base3:1.9 yamt-pagecache-base2:1.9 yamt-pagecache:1.9.0.42 yamt-pagecache-base:1.9 cherry-xenmp:1.9.0.40 cherry-xenmp-base:1.9 bouyer-quota2-nbase:1.9 bouyer-quota2:1.9.0.38 bouyer-quota2-base:1.9 matt-mips64-premerge-20101231:1.9 matt-nb5-mips64-premerge-20101231:1.9 matt-nb5-pq3:1.9.0.36 matt-nb5-pq3-base:1.9 netbsd-5-1:1.9.0.34 netbsd-5-1-RELEASE:1.9 netbsd-5-1-RC4:1.9 matt-nb5-mips64-k15:1.9 netbsd-5-1-RC3:1.9 netbsd-5-1-RC2:1.9 netbsd-5-1-RC1:1.9 netbsd-5-0-2-RELEASE:1.9 matt-nb5-mips64-premerge-20091211:1.9 matt-premerge-20091211:1.9 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.9 matt-nb4-mips64-k7-u2a-k9b:1.9 matt-nb5-mips64-u1-k1-k5:1.9 matt-nb5-mips64:1.9.0.32 netbsd-5-0-1-RELEASE:1.9 jym-xensuspend-nbase:1.9 netbsd-5-0:1.9.0.30 netbsd-5-0-RELEASE:1.9 netbsd-5-0-RC4:1.9 netbsd-5-0-RC3:1.9 netbsd-5-0-RC2:1.9 jym-xensuspend:1.9.0.28 jym-xensuspend-base:1.9 netbsd-5-0-RC1:1.9 mjf-devfs2-base2:1.9 netbsd-5:1.9.0.26 netbsd-5-base:1.9 matt-mips64-base2:1.9 matt-mips64:1.9.0.24 netbsd-4-0-1-RELEASE:1.9 wrstuden-revivesa-base-3:1.9 wrstuden-revivesa-base-2:1.9 wrstuden-fixsa-newbase:1.9 wrstuden-revivesa-base-1:1.9 yamt-pf42-base4:1.9 yamt-pf42-base3:1.9 hpcarm-cleanup-nbase:1.9 yamt-pf42-baseX:1.9 yamt-pf42-base2:1.9 wrstuden-revivesa:1.9.0.22 wrstuden-revivesa-base:1.9 yamt-pf42:1.9.0.20 yamt-pf42-base:1.9 mjf-devfs2:1.9.0.18 mjf-devfs2-base:1.9 keiichi-mipv6:1.9.0.16 keiichi-mipv6-base:1.9 mjf-devfs:1.9.0.14 mjf-devfs-base:1.9 matt-armv6-nbase:1.9 matt-armv6-prevmlocking:1.9 wrstuden-fixsa-base-1:1.9 netbsd-4-0:1.9.0.12 netbsd-4-0-RELEASE:1.9 cube-autoconf:1.9.0.10 cube-autoconf-base:1.9 netbsd-4-0-RC5:1.9 netbsd-4-0-RC4:1.9 netbsd-4-0-RC3:1.9 netbsd-4-0-RC2:1.9 netbsd-4-0-RC1:1.9 matt-armv6:1.9.0.8 matt-armv6-base:1.9 matt-mips64-base:1.9 hpcarm-cleanup:1.9.0.6 hpcarm-cleanup-base:1.9 netbsd-3-1-1-RELEASE:1.8 netbsd-3-0-3-RELEASE:1.8 wrstuden-fixsa:1.9.0.4 wrstuden-fixsa-base:1.9 abandoned-netbsd-4-base:1.8 abandoned-netbsd-4:1.8.0.6 netbsd-3-1:1.8.0.8 netbsd-3-1-RELEASE:1.8 netbsd-3-0-2-RELEASE:1.8 netbsd-3-1-RC4:1.8 netbsd-3-1-RC3:1.8 netbsd-3-1-RC2:1.8 netbsd-3-1-RC1:1.8 netbsd-4:1.9.0.2 netbsd-4-base:1.9 netbsd-3-0-1-RELEASE:1.8 netbsd-3-0:1.8.0.4 netbsd-3-0-RELEASE:1.8 netbsd-3-0-RC6:1.8 netbsd-3-0-RC5:1.8 netbsd-3-0-RC4:1.8 netbsd-3-0-RC3:1.8 netbsd-3-0-RC2:1.8 netbsd-3-0-RC1:1.8 netbsd-2-0-3-RELEASE:1.7 netbsd-2-1:1.7.0.8 netbsd-2-1-RELEASE:1.7 netbsd-2-1-RC6:1.7 netbsd-2-1-RC5:1.7 netbsd-2-1-RC4:1.7 netbsd-2-1-RC3:1.7 netbsd-2-1-RC2:1.7 netbsd-2-1-RC1:1.7 netbsd-2-0-2-RELEASE:1.7 netbsd-3:1.8.0.2 netbsd-3-base:1.8 netbsd-2-0-1-RELEASE:1.7 netbsd-2:1.7.0.6 netbsd-2-base:1.7 netbsd-2-0-RELEASE:1.7 netbsd-2-0-RC5:1.7 netbsd-2-0-RC4:1.7 netbsd-2-0-RC3:1.7 netbsd-2-0-RC2:1.7 netbsd-2-0-RC1:1.7 netbsd-2-0:1.7.0.4 netbsd-2-0-base:1.7 netbsd-1-6-PATCH002-RELEASE:1.7 netbsd-1-6-PATCH002:1.7 netbsd-1-6-PATCH002-RC4:1.7 netbsd-1-6-PATCH002-RC3:1.7 netbsd-1-6-PATCH002-RC2:1.7 netbsd-1-6-PATCH002-RC1:1.7 netbsd-1-6-PATCH001:1.7 netbsd-1-6-PATCH001-RELEASE:1.7 netbsd-1-6-PATCH001-RC3:1.7 netbsd-1-6-PATCH001-RC2:1.7 netbsd-1-6-PATCH001-RC1:1.7 fvdl_fs64_base:1.7 netbsd-1-6-RELEASE:1.7 netbsd-1-6-RC3:1.7 netbsd-1-6-RC2:1.7 netbsd-1-6-RC1:1.7 netbsd-1-6:1.7.0.2 netbsd-1-6-base:1.7 netbsd-1-5-PATCH003:1.2.4.1 netbsd-1-5-PATCH002:1.2.4.1 netbsd-1-5-PATCH001:1.2.4.1 netbsd-1-5-RELEASE:1.2.4.1 netbsd-1-5-BETA2:1.2.4.1 netbsd-1-5-BETA:1.2.4.1 netbsd-1-5-ALPHA2:1.2 netbsd-1-5:1.2.0.4 netbsd-1-5-base:1.2 minoura-xpg4dl:1.2.0.2 minoura-xpg4dl-base:1.2 rc-d-2000-03-10:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.9 date 2006.10.08.18.08.39; author elad; state Exp; branches; next 1.8; 1.8 date 2004.08.13.18.08.03; author mycroft; state Exp; branches; next 1.7; 1.7 date 2002.03.22.04.33.57; author thorpej; state Exp; branches; next 1.6; 1.6 date 2001.04.29.23.57.25; author lukem; state Exp; branches; next 1.5; 1.5 date 2001.04.25.23.20.15; author lukem; state Exp; branches; next 1.4; 1.4 date 2001.04.25.11.48.22; author jdolecek; state Exp; branches; next 1.3; 1.3 date 2000.09.19.13.04.38; author lukem; state Exp; branches; next 1.2; 1.2 date 2000.05.13.08.45.06; author lukem; state Exp; branches 1.2.4.1; next 1.1; 1.1 date 2000.03.10.11.53.25; author lukem; state Exp; branches 1.1.1.1; next ; 1.2.4.1 date 2000.10.02.01.07.16; author lukem; state Exp; branches; next ; 1.1.1.1 date 2000.03.10.11.53.25; author lukem; state Exp; branches; next ; desc @@ 1.9 log @PR/31497: Robert Elz: rc.d/accounting should have KEYWORD: shutdown @ text @#!/bin/sh # # $NetBSD: accounting,v 1.8 2004/08/13 18:08:03 mycroft Exp $ # # PROVIDE: accounting # REQUIRE: mountall # BEFORE: DAEMON # KEYWORD: shutdown $_rc_subr_loaded . /etc/rc.subr name="accounting" rcvar=$name accounting_command="/usr/sbin/accton" accounting_file="/var/account/acct" start_cmd="accounting_start" stop_cmd="accounting_stop" accounting_start() { if [ ! -f ${accounting_file} ]; then echo "Creating accounting file ${accounting_file}" ( umask 022 ; > ${accounting_file} ) fi echo "Turning on accounting." ${accounting_command} ${accounting_file} } accounting_stop() { echo "Turning off accounting." ${accounting_command} } load_rc_config $name run_rc_command "$1" @ 1.8 log @Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this for a speedup by doing: $_rc_subr_loaded . /etc/rc.subr @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.7 2002/03/22 04:33:57 thorpej Exp $ d9 1 @ 1.7 log @Correct the "direction" of the barrier dependencies (DAEMON, LOGIN, NETWORKING, and SERVERS) by specifying that certain things should come BEFORE a given barrier, rather than having the barrier REQUIRE a service. This allows scripts to be removed without having to edit the barrier dependencies. As discussed on tech-userlevel, and approved by Luke. @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.6 2001/04/29 23:57:25 lukem Exp $ d10 1 a10 1 . /etc/rc.subr @ 1.6 log @kre notes that "echo -n" is superfluous when creating a zero length file @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.5 2001/04/25 23:20:15 lukem Exp $ d8 1 @ 1.5 log @- create the default accounting file with a umask of 022. - set and use $accounting_command (/usr/sbin/accton) and $accounting_file (/var/account/acct) - fix spelo in message @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.4 2001/04/25 11:48:22 jdolecek Exp $ d22 1 a22 1 ( umask 022 ; echo -n > ${accounting_file} ) @ 1.4 log @If the accouting file doesn't exist, create it if possible. Addresses misc/12735 by Robert Elz. @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.3 2000/09/19 13:04:38 lukem Exp $ d13 2 d20 3 a22 3 if [ ! -f /var/account/acct ]; then echo "Creating accouting file /var/account/acct" >> /var/account/acct d25 1 a25 1 /usr/sbin/accton /var/account/acct d31 1 a31 1 /usr/sbin/accton @ 1.3 log @- only perform the checkyesno on the variable named in $rcvar (rather than implicitly using $name if $rcvar isn't set), and always perform this check, even when using start_cmd (et al). this check is performed before the pidcmd is run, speeding up scripts that weren't going to be run anyway. this should speed up booting slow systems. - take advantage of the above and remove start_precmd="checkyesno foo" in scripts that use start_cmd. - explicitly set rcvar=foo in the rc.d/foo scripts which have an equivalent rc.conf entry - fix `rcvar' and `restart' when $rcvar isn't set. these above changes fix PR [bin/11027]. - when doing `force*', ignore the return value of *_precmd. this fixes PR [bin/10781]. - rename what sysdb provides from `databases' to `sysdb', to reflect the name of the script. - improve the comments in rc.subr @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.2 2000/05/13 08:45:06 lukem Exp $ d18 3 a20 3 if [ -f /var/account/acct ]; then echo "Turning on accounting." /usr/sbin/accton /var/account/acct d22 2 @ 1.2 log @Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf. This allows us or a user to change the configuration file method in one place - rc.subr - without having to edit all of the rc.d/* files. @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.1.1.1 2000/03/10 11:53:25 lukem Exp $ d12 1 a12 1 start_precmd="checkyesno accounting" a13 1 stop_precmd=$start_precmd @ 1.2.4.1 log @pull up rev 1.3 (approved by thorpej): - always use $rcvar to determine the name of the var to checkyesno - fix force* @ text @d3 1 a3 1 # $NetBSD: accounting,v 1.3 2000/09/19 13:04:38 lukem Exp $ d12 1 a12 1 rcvar=$name d14 1 @ 1.1 log @Initial revision @ text @d3 1 a3 1 # $NetBSD$ a9 1 . /etc/rc.conf d31 1 @ 1.1.1.1 log @rc.d scripts derived from /etc/rc @ text @@