Skip to content

Commit

Permalink
Merge pull request #1115 from lrusak/docker
Browse files Browse the repository at this point in the history
docker: add temporary cleanup method for old systemd service
  • Loading branch information
chewitt authored Jan 2, 2017
2 parents 8e3dbe5 + 3e7e91c commit e51f024
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/addons/service/docker/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
8.1.111
- Add temporary cleanup for old systemd service

8.1.110
- Update to docker 1.12.5
- Adjust the systemd service file
Expand Down
2 changes: 1 addition & 1 deletion packages/addons/service/docker/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

PKG_NAME="docker"
PKG_VERSION="1.12.5"
PKG_REV="110"
PKG_REV="111"
PKG_ARCH="any"
PKG_ADDON_PROJECTS="Generic RPi RPi2 imx6 WeTek_Hub WeTek_Play_2 Odroid_C2"
PKG_LICENSE="ASL"
Expand Down
32 changes: 32 additions & 0 deletions packages/addons/service/docker/source/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,38 @@ class Main(object):

def __init__(self, *args, **kwargs):

#############################
# Temp cleanup for old method

restart_docker = False

if os.path.islink('/storage/.config/system.d/service.system.docker.socket'):
os.remove('/storage/.config/system.d/service.system.docker.socket')
if os.path.islink('/storage/.config/system.d/docker.socket'):
os.remove('/storage/.config/system.d/docker.socket')

if os.path.islink('/storage/.config/system.d/service.system.docker.service'):
if 'systemd' in os.readlink('/storage/.config/system.d/service.system.docker.service'):
os.remove('/storage/.config/system.d/service.system.docker.service')
restart_docker = True

if os.path.islink('/storage/.config/system.d/docker.service'):
if 'systemd' in os.readlink('/storage/.config/system.d/docker.service'):
os.remove('/storage/.config/system.d/docker.service')
restart_docker = True

if os.path.islink('/storage/.config/system.d/multi-user.target.wants/service.system.docker.service'):
if 'systemd' in os.readlink('/storage/.config/system.d/multi-user.target.wants/service.system.docker.service'):
os.remove('/storage/.config/system.d/multi-user.target.wants/service.system.docker.service')
restart_docker = True

if restart_docker:
oe.execute('systemctl enable /storage/.kodi/addons/service.system.docker/system.d/service.system.docker.service')
oe.execute('systemctl restart /storage/.kodi/addons/service.system.docker/system.d/service.system.docker.service')

# end temp cleanup
#############################

monitor = DockerMonitor(self)

while not monitor.abortRequested():
Expand Down

0 comments on commit e51f024

Please sign in to comment.