58436aa600b319be19cd64263acd4b31bf8fc2fc
[dragonfly.git] / etc / rc.d / vfs_accounting
1 #!/bin/sh
2
3 # PROVIDE: vfs_accounting
4 # REQUIRE: mountcritlocal
5 # BEFORE:  LOGIN
6
7 . /etc/rc.subr
8
9 name="vfs_accounting"
10 rcvar=`set_rcvar`
11 start_cmd="vas_start"
12
13 vas_start()
14 {
15         if checkyesno vfs_accounting_enable; then
16                 # For each dir in $vfs_accounting_sync, run vquota sync
17                 #
18                 case ${vfs_accounting_sync} in
19                 [Nn][Oo] | '')
20                         ;;
21                 *)
22                         echo -n 'Synchronizing VFS counters: '
23                         for dir in ${vfs_accounting_sync}; do
24                                 echo -n "${dir} "
25                                 if [ -d "${dir}" ]; then
26                                         /sbin/vquota sync ${dir}
27                                 fi
28                         done
29                         echo '.'
30                         ;;
31                 esac
32         fi
33 }
34
35 load_rc_config $name
36 run_rc_command "$1"