# Managed by Zoox Ansible role cgroup
description "CGroup Config Setup"

start on runlevel [2345]
stop on runlevel [!2345]
respawn

setuid root
setgid root

pre-start script
  date '+%Y%m%d-%H%M%S %s'
  if test -f "/opt/zoox/ai/zoox/bin/cgroup_check"; then
    /opt/zoox/ai/zoox/bin/cgroup_check --apply
  elif test -f "/etc/cgconfig.conf"; then
    # Fall back to old libcg tools
    # TODO(tom) remove once all supported branches have new CG library
    /usr/sbin/cgconfigparser -l /etc/cgconfig.conf
  fi
end script
