From e59da5beb32c92e98cae8ac8fab92c89cc6c45b5 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 7 Oct 2016 13:39:47 +0200 Subject: [PATCH] docker: add systemd service file Some options of docker.service are commented out, because they currently don't work on our system (to old systemd). We want to start docker only on demand. --- docker.be0 | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docker.be0 b/docker.be0 index 584e9c064..3a5f90c65 100755 --- a/docker.be0 +++ b/docker.be0 @@ -1,6 +1,6 @@ #!/usr/bin/env beesh -# BEE_VERSION docker-1.12.1-0.bee +# BEE_VERSION docker-1.12.1-1.bee # NOTE: We require a running docker environment. For the first bootstrap # this can be provided by the package docker_binary @@ -69,6 +69,7 @@ mee_build() { mee_install() { install --directory $D$BINDIR install --directory $D$SYSCONFDIR/default + install --directory $D$SYSCONFDIR/systemd/system V=$PKGVERSION @@ -90,6 +91,38 @@ mee_install() { cat >$D$SYSCONFDIR/default/docker <<-'__EOF__' DOCKER_OPTS="--storage-driver=overlay2" __EOF__ + + cat >$D$SYSCONFDIR/systemd/system/docker.service <<-'__EOF__' + [Unit] + Description=Docker Application Container Engine + #Documentation=https://docs.docker.com + After=network.target + + [Service] + Type=notify + # the default is not to use systemd for cgroups because the delegate issues still + # exists and systemd currently does not support the cgroup feature set required + # for containers run by docker + ExecStart=/usr/bin/dockerd + ExecReload=/bin/kill -s HUP $MAINPID + # Having non-zero Limit*s causes performance problems due to accounting overhead + # in the kernel. We recommend using cgroups to do container-local accounting. + #LimitNOFILE=infinity + #LimitNPROC=infinity + #LimitCORE=infinity + # Uncomment TasksMax if your systemd version supports it. + # Only systemd 226 and above support this version. + #TasksMax=infinity + #TimeoutStartSec=0 + # set delegate yes so that systemd does not reset the cgroups of docker containers + #Delegate=yes + # kill only the docker process, not all processes in the cgroup + KillMode=process + StandardOutput=syslog + + [Install] + #WantedBy=multi-user.target + __EOF__ } ## by default this may be 'make install DESTDIR="${D}"'