diff --git a/packages/mediacenter/kodi/system.d/kodi-autostart.service b/packages/mediacenter/kodi/system.d/kodi-autostart.service index 7c20c134e1..e3fbd81454 100644 --- a/packages/mediacenter/kodi/system.d/kodi-autostart.service +++ b/packages/mediacenter/kodi/system.d/kodi-autostart.service @@ -1,7 +1,7 @@ [Unit] Description=Kodi user autostart script Before=kodi.service -After=graphical.target +After=network-online.target graphical.target ConditionPathExists=/storage/.config/autostart.sh [Service] diff --git a/packages/mediacenter/kodi/system.d/kodi-waitonnetwork.service b/packages/mediacenter/kodi/system.d/kodi-waitonnetwork.service index 39cdee46b8..9785da7fdc 100644 --- a/packages/mediacenter/kodi/system.d/kodi-waitonnetwork.service +++ b/packages/mediacenter/kodi/system.d/kodi-waitonnetwork.service @@ -1,16 +1,19 @@ [Unit] Description=Wait on network +Requisite=connman.service After=connman.service -Before=kodi-autostart.service kodi.service +Before=network-online.target +DefaultDependencies=no +Conflicts=shutdown.target ConditionPathExists=/storage/.cache/openelec/network_wait [Service] Type=oneshot EnvironmentFile=/storage/.cache/openelec/network_wait ExecStartPre=/bin/sh -c 'echo "waiting on Network to come online ... (max. $WAIT_NETWORK_TIME sec.)"' -ExecStart=/usr/bin/cm-online ${WAIT_NETWORK_TIME} +ExecStart=/usr/sbin/connmand-wait-online --timeout=${WAIT_NETWORK_TIME} StandardOutput=tty RemainAfterExit=yes [Install] -WantedBy=kodi.service +WantedBy=network-online.target diff --git a/packages/mediacenter/kodi/system.d/kodi.service b/packages/mediacenter/kodi/system.d/kodi.service index e34b9e8fd0..0c170b15d3 100644 --- a/packages/mediacenter/kodi/system.d/kodi.service +++ b/packages/mediacenter/kodi/system.d/kodi.service @@ -1,7 +1,8 @@ [Unit] Description=Kodi Media Center -After=graphical.target +After=network-online.target graphical.target Requires=graphical.target +Wants=network-online.target [Service] Environment=DISPLAY=:0.0 diff --git a/packages/mediacenter/kodi/system.d/kodi.target b/packages/mediacenter/kodi/system.d/kodi.target index 95dbd0ae9a..29cda1c50b 100644 --- a/packages/mediacenter/kodi/system.d/kodi.target +++ b/packages/mediacenter/kodi/system.d/kodi.target @@ -1,7 +1,8 @@ [Unit] Description=Kodi Mediacenter Interface -Requires=multi-user.target graphical.target -After=graphical.target +Requires=multi-user.target graphical.target network-online.target +After=network-online.target graphical.target +Wants=network-online.target Conflicts=rescue.target AllowIsolate=yes diff --git a/packages/network/connman/package.mk b/packages/network/connman/package.mk index ba8e647b4e..776ef2240a 100644 --- a/packages/network/connman/package.mk +++ b/packages/network/connman/package.mk @@ -76,7 +76,6 @@ post_makeinstall_target() { mkdir -p $INSTALL/usr/bin cp -P client/connmanctl $INSTALL/usr/bin - cp -P $PKG_DIR/scripts/cm-online $INSTALL/usr/bin mkdir -p $INSTALL/usr/lib/connman cp -P $PKG_DIR/scripts/connman-setup $INSTALL/usr/lib/connman diff --git a/packages/network/connman/scripts/cm-online b/packages/network/connman/scripts/cm-online deleted file mode 100755 index dc1844f060..0000000000 --- a/packages/network/connman/scripts/cm-online +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) -# -# OpenELEC is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# OpenELEC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenELEC. If not, see . -################################################################################ - -# Wait for the network to come up and exit after timeout or if network is online - -# default 30sec -[ ! -z $1 ] && TIMEOUT=$1 || TIMEOUT=30 - -for i in $(seq 1 $TIMEOUT) ; do - STATUS=$(ifconfig | sed -e '/inet addr:/!d' -e '/127.0.0.1/d' |wc -l) - [ "$STATUS" -gt 0 ] && break - usleep 1000000 -done diff --git a/packages/network/connman/system.d/connman.service b/packages/network/connman/system.d/connman.service index ccca00e77c..47610ce044 100644 --- a/packages/network/connman/system.d/connman.service +++ b/packages/network/connman/system.d/connman.service @@ -1,8 +1,9 @@ [Unit] Description=Connection service -Requires=dbus.socket -After=dbus.socket -Before=network.target +DefaultDependencies=false +Conflicts=shutdown.target +Before=network.target multi-user.target shutdown.target +After=dbus.service Wants=network.target [Service] @@ -15,8 +16,6 @@ ExecStartPre=-/bin/sh -c "cat /storage/.cache/hostname > /proc/sys/kernel/hostna ExecStartPre=-/bin/sh -c "cat /storage/.config/hosts.conf > /etc/hosts" ExecStartPre=/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 up ExecStart=/bin/sh -c ". /usr/lib/connman/connman-setup; exec /usr/sbin/connmand -nr $CONNMAN_MAIN $CONNMAN_DEBUG" -# send SIGKILL on stop to keep ip configuration -KillSignal=SIGKILL StandardOutput=null RestartSec=2 StartLimitInterval=0 diff --git a/packages/network/connman/system.d/network-online.service b/packages/network/connman/system.d/network-online.service index 267e248b17..a6d42403f9 100644 --- a/packages/network/connman/system.d/network-online.service +++ b/packages/network/connman/system.d/network-online.service @@ -1,13 +1,17 @@ [Unit] -Description=Connection Manager Wait Online +Description=Wait for network to be configured by ConnMan Requisite=connman.service After=connman.service +Before=network-online.target +DefaultDependencies=no +Conflicts=shutdown.target [Service] Type=oneshot ExecStartPre=/bin/sh -c 'echo "waiting on Network to come online ..."' -ExecStart=/usr/bin/cm-online 30 +ExecStart=/usr/sbin/connmand-wait-online --timeout=30 StandardOutput=tty +RemainAfterExit=yes [Install] -WantedBy=multi-user.target +WantedBy=network-online.target