{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/18796","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/18796/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/18796/comments","events_url":"https://api.github.com/repos/docker/docker/issues/18796/events","html_url":"https://github.com/docker/docker/issues/18796","id":123126316,"number":18796,"title":"systemd v219 can't run in docker 1.9 due to readonly /sys/fs/cgroup","user":{"login":"Dieken","id":2365,"avatar_url":"https://avatars.githubusercontent.com/u/2365?v=3","gravatar_id":"","url":"https://api.github.com/users/Dieken","html_url":"https://github.com/Dieken","followers_url":"https://api.github.com/users/Dieken/followers","following_url":"https://api.github.com/users/Dieken/following{/other_user}","gists_url":"https://api.github.com/users/Dieken/gists{/gist_id}","starred_url":"https://api.github.com/users/Dieken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dieken/subscriptions","organizations_url":"https://api.github.com/users/Dieken/orgs","repos_url":"https://api.github.com/users/Dieken/repos","events_url":"https://api.github.com/users/Dieken/events{/privacy}","received_events_url":"https://api.github.com/users/Dieken/received_events","type":"User","site_admin":false},"labels":[{"id":181681881,"url":"https://api.github.com/repos/docker/docker/labels/area/systemd","name":"area/systemd","color":"fbca04","default":false},{"id":375219499,"url":"https://api.github.com/repos/docker/docker/labels/version/1.9","name":"version/1.9","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2015-12-20T01:58:49Z","updated_at":"2016-11-07T23:05:22Z","closed_at":null,"body":"Running systemd in docker is a long-standing issue, some months ago I surprisedly found I can smoothly run \"systemd-container-208\" in docker 1.8 with \"--cap-add SYS_ADMIN\"(I feel this is a little safer than --privileged :-), but in docker 1.9 this breaks,  the cause is \"/sys/fs/cgroup\" is readonly by default now, I have to use this hack:\n\n``` bash\n$ docker run -dt -e container=docker --cap-add SYS_ADMIN centos:latest bash -c 'mount -oremount,rw /sys/fs/cgroup; mkdir /sys/fs/cgroup/systemd; mount -oremount,ro /sys/fs/cgroup; exec /usr/sbin/init'\n```\n\nI'm not sure what the best solution is,  maybe ask systemd developer to try to remount /sys/fs/cgroup before creating /sys/fs/cgroup/systemd?   or docker just creates that directory anyway? I see there is systemd support in docker now, but don't know what it is doing: https://github.com/opencontainers/runc/tree/master/libcontainer/cgroups/systemd\n\nDocker 1.8 (boot2docker v1.8.0):\n\n``` bash\n$ docker run --rm -it -e container=docker centos:latest bash -c 'mount | grep /sys/fs/cgroup'\ntmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime)\ncgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)\ncgroup on /sys/fs/cgroup/cpu type cgroup (ro,nosuid,nodev,noexec,relatime,cpu)\ncgroup on /sys/fs/cgroup/cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpuacct)\ncgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)\ncgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)\ncgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)\ncgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)\ncgroup on /sys/fs/cgroup/net_cls type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls)\ncgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)\ncgroup on /sys/fs/cgroup/net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_prio)\n\n$ docker version\nClient version: 1.7.1\nClient API version: 1.19\nGo version (client): go1.4.2\nGit commit (client): 786b29d\nOS/Arch (client): darwin/amd64\nServer version: 1.8.1\nServer API version: 1.20\nGo version (server): go1.4.2\nGit commit (server): d12ea79\nOS/Arch (server): linux/amd64\n\n$ docker info\nContainers: 3\nImages: 136\nStorage Driver: aufs\n Root Dir: /mnt/sda1/var/lib/docker/aufs\n Backing Filesystem: extfs\n Dirs: 142\n Dirperm1 Supported: true\nExecution Driver: native-0.2\nLogging Driver: json-file\nKernel Version: 4.0.9-boot2docker\nOperating System: Boot2Docker 1.8.1 (TCL 6.3); master : 7f12e95 - Thu Aug 13 03:24:56 UTC 2015\nCPUs: 8\nTotal Memory: 1.955 GiB\nName: boot2docker\nID: 25AA:2PM7:VJDC:2YPU:QTKF:ODD5:HSAQ:EWGV:2XOU:3LHD:5FF4:6DMG\nDebug mode (server): true\nFile Descriptors: 30\nGoroutines: 38\nSystem Time: 2015-12-20T02:03:36.73673363Z\nEventsListeners: 0\nInit SHA1:\nInit Path: /usr/local/bin/docker\nDocker Root Dir: /mnt/sda1/var/lib/docker\n\n$ uname -a\nDarwin localhost 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,5 Darwin\n\n$ boot2docker ssh uname -a\nLinux boot2docker 4.0.9-boot2docker #1 SMP Thu Aug 13 03:05:44 UTC 2015 x86_64 GNU/Linux\n```\n\nDocker 1.9 (docker toolbox, docker-machine 0.5.0):\n\n``` bash\n$ docker run --rm -it -e container=docker centos:latest bash -c 'mount | grep /sys/fs/cgroup'\ntmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)\ncgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)\ncgroup on /sys/fs/cgroup/cpu type cgroup (ro,nosuid,nodev,noexec,relatime,cpu)\ncgroup on /sys/fs/cgroup/cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpuacct)\ncgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)\ncgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)\ncgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)\ncgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)\ncgroup on /sys/fs/cgroup/net_cls type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls)\ncgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)\ncgroup on /sys/fs/cgroup/net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_prio)\ncgroup on /sys/fs/cgroup/hugetlb type cgroup (ro,nosuid,nodev,noexec,relatime,hugetlb)\n\n$ docker version\nClient:\n Version:      1.9.0\n API version:  1.21\n Go version:   go1.4.3\n Git commit:   76d6bc9\n Built:        Tue Nov  3 19:20:09 UTC 2015\n OS/Arch:      darwin/amd64\n\nServer:\n Version:      1.9.0\n API version:  1.21\n Go version:   go1.4.3\n Git commit:   76d6bc9\n Built:        Tue Nov  3 19:20:09 UTC 2015\n OS/Arch:      linux/amd64\n\n$ docker info\nContainers: 3\nImages: 10\nServer Version: 1.9.0\nStorage Driver: aufs\n Root Dir: /mnt/sda1/var/lib/docker/aufs\n Backing Filesystem: extfs\n Dirs: 17\n Dirperm1 Supported: true\nExecution Driver: native-0.2\nLogging Driver: json-file\nKernel Version: 4.1.12-boot2docker\nOperating System: Boot2Docker 1.9.0 (TCL 6.4); master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015\nCPUs: 1\nTotal Memory: 1.956 GiB\nName: default\nID: WDPS:UFA4:DWK6:54U4:JIPX:6K6U:HDMV:MXJU:L4DA:JL7N:4A3A:CFRF\nDebug mode (server): true\n File Descriptors: 17\n Goroutines: 28\n System Time: 2015-12-20T02:03:12.399240046Z\n EventsListeners: 0\n Init SHA1:\n Init Path: /usr/local/bin/docker\n Docker Root Dir: /mnt/sda1/var/lib/docker\nLabels:\n provider=virtualbox\n\n$ uname -a\nDarwin localhost 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,5 Darwin\n\n$ docker-machine ssh default uname -a\nLinux default 4.1.12-boot2docker #1 SMP Tue Nov 3 06:03:36 UTC 2015 x86_64 GNU/Linux\n```\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/258992365","html_url":"https://github.com/docker/docker/issues/18796#issuecomment-258992365","issue_url":"https://api.github.com/repos/docker/docker/issues/18796","id":258992365,"user":{"login":"howdoicomputer","id":6774447,"avatar_url":"https://avatars.githubusercontent.com/u/6774447?v=3","gravatar_id":"","url":"https://api.github.com/users/howdoicomputer","html_url":"https://github.com/howdoicomputer","followers_url":"https://api.github.com/users/howdoicomputer/followers","following_url":"https://api.github.com/users/howdoicomputer/following{/other_user}","gists_url":"https://api.github.com/users/howdoicomputer/gists{/gist_id}","starred_url":"https://api.github.com/users/howdoicomputer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howdoicomputer/subscriptions","organizations_url":"https://api.github.com/users/howdoicomputer/orgs","repos_url":"https://api.github.com/users/howdoicomputer/repos","events_url":"https://api.github.com/users/howdoicomputer/events{/privacy}","received_events_url":"https://api.github.com/users/howdoicomputer/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T23:05:22Z","updated_at":"2016-11-07T23:05:22Z","body":"@rhatdan \r\n\r\n```\r\nhowdoicomputer@spacecow ~/workspace/work/cookbooks/tl_seyren_cookbook\r\n (CLOUDOPS-566)$ systemctl --version\r\nsystemd 231\r\n+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +ID\r\n```\r\n\r\nYeah, I built and ran the image on Arch.\r\n\r\n```\r\nhowdoicomputer@spacecow ~/workspace/work/cookbooks/tl_seyren_cookbook\r\n (CLOUDOPS-566)$ docker --version\r\nDocker version 1.12.3, build 6b644ec\r\n```"}}
{"actor":{"display_login":"howdoicomputer"}}