From 1d926643e03413f77e6c8ff7c81e192366f0ca7a Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Sun, 25 Dec 2016 22:54:11 -0800 Subject: [PATCH] docker: update to 1.12.5, let LibreELEC handle the systemd service --- packages/addons/service/docker/changelog.txt | 4 ++ packages/addons/service/docker/package.mk | 4 +- .../addons/service/docker/source/default.py | 47 ------------------- .../service.system.docker.service | 13 +++-- .../systemd/service.system.docker.socket | 13 ----- 5 files changed, 15 insertions(+), 66 deletions(-) rename packages/addons/service/docker/source/{systemd => system.d}/service.system.docker.service (57%) delete mode 100644 packages/addons/service/docker/source/systemd/service.system.docker.socket diff --git a/packages/addons/service/docker/changelog.txt b/packages/addons/service/docker/changelog.txt index 39071b7066e..08579bc8c6b 100644 --- a/packages/addons/service/docker/changelog.txt +++ b/packages/addons/service/docker/changelog.txt @@ -1,3 +1,7 @@ +7.0.110 +- Update to docker 1.12.5 +- Adjust the systemd service file + 7.0.109 - Update to docker 1.12.3 diff --git a/packages/addons/service/docker/package.mk b/packages/addons/service/docker/package.mk index fe08b435497..8ed98ae023f 100644 --- a/packages/addons/service/docker/package.mk +++ b/packages/addons/service/docker/package.mk @@ -17,8 +17,8 @@ ################################################################################ PKG_NAME="docker" -PKG_VERSION="1.12.3" -PKG_REV="109" +PKG_VERSION="1.12.5" +PKG_REV="110" PKG_ARCH="any" PKG_ADDON_PROJECTS="Generic RPi RPi2" PKG_LICENSE="ASL" diff --git a/packages/addons/service/docker/source/default.py b/packages/addons/service/docker/source/default.py index cc5fa4ff28b..8bb8c8a831f 100644 --- a/packages/addons/service/docker/source/default.py +++ b/packages/addons/service/docker/source/default.py @@ -31,10 +31,6 @@ __author__ = 'lrusak' __addon__ = xbmcaddon.Addon() __path__ = __addon__.getAddonInfo('path') -__service__ = __path__ + '/systemd/' + __addon__.getAddonInfo('id') + '.service' -__servicename__ = __addon__.getAddonInfo('id') + '.service' -__socket__ = __path__ + '/systemd/' + __addon__.getAddonInfo('id') + '.socket' -__socketname__ = __addon__.getAddonInfo('id') + '.socket' sys.path.append(__path__ + '/lib') import dockermon @@ -278,54 +274,11 @@ def __init__(self, *args, **kwargs): monitor = DockerMonitor(self) - if not Docker().is_active(): - if not Docker().is_enabled(): - Docker().enable() - Docker().start() - while not monitor.abortRequested(): if monitor.waitForAbort(): # we don't want to stop or disable docker while it's installed pass -class Docker(object): - - def enable(self): - self.execute('systemctl enable ' + __service__) - self.execute('systemctl enable ' + __socket__) - - def disable(self): - self.execute('systemctl disable ' + __servicename__) - self.execute('systemctl disable ' + __socketname__) - - def is_enabled(self): - if self.execute('systemctl is-enabled ' + __servicename__, get_result=1).strip('\n') == 'enabled': - return True - else: - return False - - def start(self): - self.execute('systemctl start ' + __servicename__) - - def stop(self): - self.execute('systemctl stop ' + __servicename__) - - def is_active(self): - if self.execute('systemctl is-active ' + __servicename__, get_result=1).strip('\n') == 'active': - return True - else: - return False - - def execute(self, command_line, get_result=0): - result = oe.execute(command_line, get_result=get_result) - if get_result: - return result - - def restart(self): - if self.is_active(): - self.stop() - self.start() - class DockerMonitor(xbmc.Monitor): def __init__(self, *args, **kwargs): diff --git a/packages/addons/service/docker/source/systemd/service.system.docker.service b/packages/addons/service/docker/source/system.d/service.system.docker.service similarity index 57% rename from packages/addons/service/docker/source/systemd/service.system.docker.service rename to packages/addons/service/docker/source/system.d/service.system.docker.service index 74c0261c78d..4d5e9c975eb 100644 --- a/packages/addons/service/docker/source/systemd/service.system.docker.service +++ b/packages/addons/service/docker/source/system.d/service.system.docker.service @@ -1,19 +1,24 @@ [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com -After=network.target docker.socket -Requires=docker.socket +After=network.target [Service] Type=notify Environment=PATH=/bin:/sbin:/usr/bin:/usr/sbin:/storage/.kodi/addons/service.system.docker/bin ExecStartPre=/storage/.kodi/addons/service.system.docker/bin/docker-config EnvironmentFile=-/storage/.kodi/userdata/addon_data/service.system.docker/config/docker.conf -ExecStart=/storage/.kodi/addons/service.system.docker/bin/dockerd --host=fd:// --group=root $DOCKER_DAEMON_OPTS $DOCKER_STORAGE_OPTS -MountFlags=slave +ExecStart=/storage/.kodi/addons/service.system.docker/bin/dockerd --exec-opt native.cgroupdriver=systemd \ + --group=root \ + $DOCKER_DAEMON_OPTS \ + $DOCKER_STORAGE_OPTS +ExecReload=/bin/kill -s HUP $MAINPID +TasksMax=8192 LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity +TimeoutStartSec=0 +Restart=on-abnormal [Install] WantedBy=multi-user.target diff --git a/packages/addons/service/docker/source/systemd/service.system.docker.socket b/packages/addons/service/docker/source/systemd/service.system.docker.socket deleted file mode 100644 index 578b38bc982..00000000000 --- a/packages/addons/service/docker/source/systemd/service.system.docker.socket +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Docker Socket for the API -PartOf=docker.service - -[Socket] -ListenStream=/var/run/docker.sock -SocketMode=0660 -SocketUser=root -SocketGroup=root - -[Install] -WantedBy=sockets.target -Alias=docker.socket