Skip to content

Commit

Permalink
Merge pull request #1095 from lrusak/docker-libreelec-7.0
Browse files Browse the repository at this point in the history
backport of #1094  (docker: update to 1.12.5, let LibreELEC handle the systemd service)
  • Loading branch information
chewitt authored Dec 27, 2016
2 parents 82cc26e + 1d92664 commit 9fd2df1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 66 deletions.
4 changes: 4 additions & 0 deletions packages/addons/service/docker/changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/addons/service/docker/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
47 changes: 0 additions & 47 deletions packages/addons/service/docker/source/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

This file was deleted.

0 comments on commit 9fd2df1

Please sign in to comment.