为什么在14.04重启时没有读取cgconfig.conf?

我最近将版本从12.04升级到14.04,发现我的cgconfig.conf文件在启动时不再被读取。

该文件似乎是正确的,在某种意义上我可以明确加载它

sudo cgconfigparser -l /etc/cgconfig.conf 

但这不会在重新启动时自动发生,这意味着在启动时运行的其他脚本会失败(因为它们依赖于cgexec和cgconfig.conf中定义的组)。

我需要做些什么才能自动使用该文件? (即安装一些包)我是否必须以某种方式将此文件转换为其他文件?

这曾经在升级之前正常工作,所以我对可能出错的地方感到困惑。

我认为应该负责的“cgroup-lite”软件包也已安装。

提前致谢。

由于修复了错误#1096771,这看起来像回归。 12.04中的cgroup-bin中有一些init脚本,在13.04中删除了。 /etc/init/cgconfig.conf服务文件包含在pre-start script节中:

 /usr/sbin/cgconfigparser -l $CGCONFIG 

所以来自cgroup-bin包的cgconfig服务实际上设置了你的cgroup配置。 cgroup-lite在这些版本之间没有太大变化,所以我认为它不是为了阅读这个配置。 我建议您打开一个错误报告(也许可以编写一个新的Upstart服务(或复制旧的服务),因为它不太可能在LTS版本中更改它)。


由于仍支持12.04,因此可以使用Packages索引下载旧版本的软件包。 为方便起见,我在这里复制了/etc/init/cgconfig.conf

 description "cgconfig" author "Serge E. Hallyn " start on runlevel [2345] console output pre-start script test -x /usr/sbin/cgconfigparser || { stop; exit 0; } CREATE_DEFAULT="yes" CGCONFIG=/etc/cgconfig.conf if [ -r /etc/default/cgconfig ]; then . /etc/default/cgconfig fi # If we've already run, don't do it again! if grep -q /sys/fs/cgroup /proc/mounts; then stop exit 0 fi [ -r $CGCONFIG ] || { echo "$CGCONFIG is empty"; stop; exit 0; } mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroups /sys/fs/cgroup /usr/sbin/cgconfigparser -l $CGCONFIG if [ "$CREATE_DEFAULT" = "yes" ]; then /usr/sbin/create_default_cgroups fi end script post-stop script if [ -x /usr/sbin/cgclear ] then /usr/sbin/cgclear fi umount /sys/fs/cgroup || true end script