Avoid trying to access cpu.shares when it doesn't exist
Avoid trying to access cpu.shares when it doesn't exist

Even if cpu cgroup controller is enabled it's still possible that
cpu.shares doesn't exist.

This is the case when the kernel config has CONFIG_CGROUP_SCHED
enabled but CONFIG_FAIR_GROUP_SCHED disabled. Then docker fails to
start containers even --cpu-shares isn't specified.

$ sudo docker run -i -t ubuntu:14.04
Error response from daemon: Cannot start container 5600ae87eb9d0eca49f6bcee012247d6b4beb49c426d6cf17e2456279f9311f6: [8] System error: open /sys/fs/cgroup/cpu/docker/5600ae87eb9d0eca49f6bcee012247d6b4beb49c426d6cf17e2456279f9311f6/cpu.shares: no such file or directory

Signed-off-by: Zefan Li <a8167b9d27aca9c6624754deb52c4c6420eded04@huawei.com>

HardikDR/runc,LTD-Beget/libcontainer,BrickXu/libcontainer,jwuwork/runc,tangkun75/libcontainer,whuwxl/libcontainer,booyaa/runc,mrunalp/runc,laijs/runc,jhjeong-kr/runc,han-wang/runc,mikebrow/runc,runcom/libcontainer,adrianreber/runc,WeiZhang555/runc,cxxly/runc,cyphar/runc,HardikDR/runc,dieface/runc,ycaihua/libcontainer,liuwharton/runc,laijs/runc,whosthatknocking/runc,shishir-a412ed/runc,rsampaio/runc,gwoo/runc,markllama/runc,intfrr/runc,inatatsu/runc,zhangyancoder/libcontainer,rsampaio/runc,wangkirin/runc,willmtemple/runc,sunyuan3/runc,coolljt0725/runc,wcwxyz/runc,navidshaikh/runc,booyaa/runc,carlye566/runc,inatatsu/runc,meihuabo/runc,shenxiaochen/libcontainer,justincormack/runc,nkwilson/runc,hqhq/runc,lizf-os/runc,fabiokung/runc,tangkun75/libcontainer,runcom/libcontainer,ycaihua/runc,docker/libcontainer,coolljt0725/runc,jhjeong-kr/runc,docker/runc,navidshaikh/runc,kimh/runc,wcwxyz/runc,balajibr/runc,keloyang/runc,docker/libcontainer,w4ngyi/libcontainer,adrianreber/runc,ddnbgroup/runc,mapk0y/runc,hqhq/runc,aidanhs/runc,cyphar/runc,estesp/libcontainer,chenchun/runc,hxfeng/runc,zenlinTechnofreak/runc,shenxiaochen/libcontainer,marcosnils/runc,talwai/runc,lizf-os/runc,estesp/runc,jwuwork/runc,rhatdan/runc,whosthatknocking/runc,adrianreber/runc,dqminh/libcontainer,WeiZhang555/runc,marcosnils/runc,runcom/runc,justincormack/runc,nkwilson/runc,rhatdan/runc,rhatdan/runc,shishir-a412ed/runc,markllama/runc,HuKeping/runc,whosthatknocking/runc,BrickXu/libcontainer,WeiZhang555/runc,runcom/runc,maxamillion/runc,carlye566/runc,YujiOshima/runc,opencontainers/runc,cxxly/runc,coolljt0725/runc,keloyang/runc,LK4D4/runc,LTD-Beget/libcontainer,sallyom/runc,ddnbgroup/runc,estesp/runc,ekuric/runc,keloyang/runc,wcwxyz/runc,zhangyancoder/libcontainer,runcom/libcontainer,ChengTiesheng/runc,rootfs/runc,inatatsu/runc,chenchun/runc,dieface/runc,mYmNeo/runc,liuwharton/runc,abduld/runc,zenlinTechnofreak/runc,hxfeng/runc,laijs/runc,sallyom/runc,wking/runc,mikebrow/runc,vbatts/runc,HuKeping/runc,avagin/runc,kimh/runc,sunyuan3/runc,marcosnils/runc,ekuric/runc,sallyom/runc,maxamillion/runc,calavera/runc,ycaihua/libcontainer,subuser-security/runc,mikebrow/runc,sunyuan3/runc,HuKeping/runc,axsh/runc,clnperez/runc,rajasec/runc,jhowardmsft/runc,talwai/runc,calavera/runc,cloudfoundry-incubator/runc,han-wang/runc,estesp/libcontainer,stefanberger/runc,jhowardmsft/runc,w4ngyi/libcontainer,mheon/runc,crosbymichael/runc,kolyshkin/runc,gitido/runc,gitido/runc,ZJU-SEL/runc,mrunalp/runc,dqminh/runc,jwuwork/runc,ycaihua/runc,LTD-Beget/libcontainer,BrickXu/libcontainer,LK4D4/runc,chenchun/runc,meihuabo/runc,aidanhs/runc,stefanberger/runc,kolyshkin/runc,crosbymichael/runc,ycaihua/libcontainer,balajibr/runc,zhangyancoder/libcontainer,docker/runc,haijunTan/runc,docker/libcontainer,subuser-security/runc,meihuabo/runc,mapk0y/runc,xiaochenshen/runc,mapk0y/runc,boucher/runc,kolyshkin/runc,opencontainers/runc,YujiOshima/runc,fabiokung/runc,albertoleal/runc,shenxiaochen/libcontainer,mheon/runc,docker/runc,rootfs/runc,wangkirin/runc,kolyshkin/runc,cloudfoundry-incubator/runc,rajasec/runc,boucher/runc,booyaa/runc,navidshaikh/runc,dqminh/runc,lizf-os/runc,carlye566/runc,mheon/runc,mYmNeo/runc,whuwxl/libcontainer,runcom/runc,liuwharton/runc,ChengTiesheng/runc,YujiOshima/runc,talwai/runc,InformatiQ/runc,boucher/runc,intfrr/runc,dqminh/runc,axsh/runc,hqhq/runc,avagin/runc,dqminh/libcontainer,nkwilson/runc,mYmNeo/runc,clnperez/runc,willmtemple/runc,calavera/runc,whuwxl/libcontainer,fabiokung/runc,InformatiQ/runc,aidanhs/runc,mrunalp/runc,ekuric/runc,jhowardmsft/runc,hxfeng/runc,maxamillion/runc,shishir-a412ed/runc,abduld/runc,ChengTiesheng/runc,xiaochenshen/runc,cyphar/runc,w4ngyi/libcontainer,kimh/runc,clnperez/runc,xiaochenshen/runc,rhatdan/runc,han-wang/runc,tangkun75/libcontainer,dqminh/runc,estesp/runc,ZJU-SEL/runc,stefanberger/runc,avagin/runc,axsh/runc,dieface/runc,ZJU-SEL/runc,willmtemple/runc,cxxly/runc,vbatts/runc,zenlinTechnofreak/runc,LK4D4/runc,opencontainers/runc,wking/runc,dqminh/libcontainer,ddnbgroup/runc,rsampaio/runc,albertoleal/runc,haijunTan/runc,intfrr/runc,InformatiQ/runc,wking/runc,rajasec/runc,opencontainers/runc,subuser-security/runc,markllama/runc,jhjeong-kr/runc,abduld/runc,rootfs/runc,estesp/libcontainer,justincormack/runc,haijunTan/runc,gitido/runc,cloudfoundry-incubator/runc,vbatts/runc,albertoleal/runc,crosbymichael/runc,ycaihua/runc,HardikDR/runc,wangkirin/runc,balajibr/runc