File: //proc/3/root/etc/rc1.d/K74vzquota
#!/bin/sh
# chkconfig: 2345 10 90
# description: prepare container to use OpenVZ 2nd-level disk quotas
### BEGIN INIT INFO
# Provides: vzquota
# Required-Start: $local_fs $time $syslog
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start vzquota at the end of boot
# Description: Configure OpenVZ disk quota for a container.
### END INIT INFO
start() {
if [ ! -L /etc/mtab ]; then
rm -f /etc/mtab >/dev/null 2>&1
ln -sf /proc/mounts /etc/mtab
fi
dev=$(awk '($2 == "/") && ($4 ~ /usrquota/) && ($4 ~ /grpquota/) {print $1}' /etc/mtab)
if test -z "$dev"; then
dev="/dev/simfs"
rm -f /etc/mtab >/dev/null 2>&1
echo "/dev/simfs / reiserfs rw,usrquota,grpquota 0 0" > /etc/mtab
grep -v " / " /proc/mounts >> /etc/mtab 2>/dev/null
chmod 644 /etc/mtab
fi
[ -e "$dev" ] || mknod $dev b 0 72
quotaon -aug
}
case "$1" in
start)
start
;;
*)
exit
esac