mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
bluez: move obex init scripts to systemd
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
e5152bcb3a
commit
07bdeb6181
@ -1,47 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# start obexd
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
|
||||
(
|
||||
# can be called from openelec addon.
|
||||
# ensure that environment is sane
|
||||
. /etc/profile
|
||||
|
||||
if [ "$DEBUG" = "yes" ]; then
|
||||
OBEXD_DEBUG="-d"
|
||||
fi
|
||||
|
||||
OBEXD_ENABLED=true
|
||||
OBEXD_ROOT=/storage/downloads
|
||||
if [ -f $CONFIG_CACHE/service_bluez.conf ]; then
|
||||
. $CONFIG_CACHE/service_bluez.conf
|
||||
fi
|
||||
|
||||
if [ "$BLUEZ_ENABLED" == "true" -a "$OBEXD_ENABLED" == "true" ]; then
|
||||
progress "Starting obexd"
|
||||
wait_for_dbus
|
||||
mkdir -p "$OBEXD_ROOT"
|
||||
/usr/lib/bluetooth/obexd $OBEXD_DEBUG -r "$OBEXD_ROOT" &>/dev/null
|
||||
fi
|
||||
)&
|
@ -77,5 +77,7 @@ post_makeinstall_target() {
|
||||
post_install() {
|
||||
enable_service bluetooth-monitor.path
|
||||
enable_service bluetooth.service
|
||||
enable_service obex-monitor.path
|
||||
enable_service obex.service
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,9 @@ ConditionPathExists=/storage/.cache/services/bluez.conf
|
||||
|
||||
[Service]
|
||||
NotifyAccess=main
|
||||
# EnvironmentFile=/storage/.cache/services/avahi.conf
|
||||
EnvironmentFile=/storage/.cache/services/bluez.conf
|
||||
EnvironmentFile=-/run/openelec/debug.conf
|
||||
ExecStart=/usr/lib/bluetooth/bluetoothd $BLUETOOTH_DEBUG
|
||||
ExecStart=/usr/lib/bluetooth/bluetoothd $BLUEZ_ARGS $BLUEZ_DEBUG
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
|
||||
LimitNPROC=1
|
||||
|
||||
|
9
packages/network/bluez/system.d/obex-monitor.path
Normal file
9
packages/network/bluez/system.d/obex-monitor.path
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=OBEX configfile monitor
|
||||
|
||||
[Path]
|
||||
PathModified=/storage/.cache/services/obex.conf
|
||||
PathModified=/run/openelec/debug.conf
|
||||
|
||||
[Install]
|
||||
WantedBy=bluetooth.target
|
10
packages/network/bluez/system.d/obex-monitor.service
Normal file
10
packages/network/bluez/system.d/obex-monitor.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Bluetooth configfile monitor
|
||||
Requires=bluetooth.target bluetooth.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/systemctl restart obex.service
|
||||
|
||||
[Install]
|
||||
WantedBy=bluetooth.target
|
16
packages/network/bluez/system.d/obex.service
Normal file
16
packages/network/bluez/system.d/obex.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Bluetooth service
|
||||
Requires=bluetooth.target bluetooth.service
|
||||
After=bluetooth.service
|
||||
|
||||
ConditionPathExists=/storage/.cache/services/obex.conf
|
||||
ConditionPathExists=/storage/.cache/services/bluez.conf
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/storage/.cache/services/obex.conf
|
||||
EnvironmentFile=-/run/openelec/debug.conf
|
||||
ExecStart=/usr/lib/bluetooth/obexd $OBEX_ARGS $OBEX_DEBUG
|
||||
|
||||
[Install]
|
||||
WantedBy=bluetooth.target
|
||||
Alias=dbus-org.bluez.obex.service
|
@ -23,5 +23,7 @@ mkdir -p /run/openelec
|
||||
|
||||
cat > /run/openelec/debug.conf <<EOF
|
||||
AVAHI_DEBUG="--debug"
|
||||
BLUEZ_DEBUG="--debug"
|
||||
OBEX_DEBUG="--debug"
|
||||
XORG_DEBUG="-logverbose 6 -verbose 6"
|
||||
EOF
|
Loading…
x
Reference in New Issue
Block a user