[Users] Skipping quota at start and doing it later?

Gregor Mosheh gregor at hostgis.com
Mon May 12 13:42:50 EDT 2008


Matt Ayres wrote:
> What you want is not possible with any existing options.  You could 
> possibly edit the vz init script and removed the needs_restart line.

Ahhhh, okay. Then I guess my hack to /etc/init.d/vz is the best way to 
accomplish what I want. We already have a policy of never bypassing the 
tmpfs, so the quota stats before a power outage are good enough for our 
needs.


FYI, the fix I have applied is probably not the best, but here it is for 
posterity:

start_ves()
{
         local veid
         local velist
         local msg
         local need_restart

         need_restart=""
         cd ${CONFIG_DIR} || return
         velist=`grep -l '^ONBOOT=yes\|^ONBOOT=\"yes\"' [0-9]*.conf 
2>/dev/null |
                 sed -e 's/.conf//g' | sort -n`
         cd - >/dev/null
         sysctl -q -w net.ipv4.route.src_check=0
         for veid in $velist; do
                 [ "${veid}" = "0" ] && continue
                 __echo "Starting VE ${veid}: "
                 if [ "x${VZFASTBOOT}" = "xyes" -a "x${DISK_QUOTA}" = 
"xyes" ]; then
                         $VZQUOTA off ${veid} >/dev/null 2>&1
                 fi
                 msg=`$VZCTL start ${veid} 2>&1`
                 print_result "$msg"
         done
}



-- 
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA


More information about the Users mailing list