diff --git a/packages/network/bluez/package.mk b/packages/network/bluez/package.mk index f49285162f..04fdf3560f 100644 --- a/packages/network/bluez/package.mk +++ b/packages/network/bluez/package.mk @@ -71,6 +71,11 @@ pre_configure_target() { } post_makeinstall_target() { + rm -rf $INSTALL/lib/systemd +} + +post_install() { + enable_service bluetooth-monitor.path enable_service bluetooth.service } diff --git a/packages/network/bluez/system.d/bluetooth-monitor.path b/packages/network/bluez/system.d/bluetooth-monitor.path new file mode 100644 index 0000000000..590072e15d --- /dev/null +++ b/packages/network/bluez/system.d/bluetooth-monitor.path @@ -0,0 +1,9 @@ +[Unit] +Description=Bluetooth configfile monitor + +[Path] +PathModified=/storage/.cache/services/bluez.conf +PathModified=/run/openelec/debug.conf + +[Install] +WantedBy=bluetooth.target diff --git a/packages/network/bluez/system.d/bluetooth-monitor.service b/packages/network/bluez/system.d/bluetooth-monitor.service new file mode 100644 index 0000000000..74a1c86465 --- /dev/null +++ b/packages/network/bluez/system.d/bluetooth-monitor.service @@ -0,0 +1,10 @@ +[Unit] +Description=Bluetooth configfile monitor +Requires=bluetooth.target + +[Service] +Type=oneshot +ExecStart=/bin/systemctl restart bluetooth.service + +[Install] +WantedBy=bluetooth.target diff --git a/packages/network/bluez/system.d/bluetooth.service b/packages/network/bluez/system.d/bluetooth.service new file mode 100644 index 0000000000..44657ee3a2 --- /dev/null +++ b/packages/network/bluez/system.d/bluetooth.service @@ -0,0 +1,17 @@ +[Unit] +Description=Bluetooth service +Requires=bluetooth.target + +ConditionPathExists=/storage/.cache/services/bluez.conf + +[Service] +NotifyAccess=main +# EnvironmentFile=/storage/.cache/services/avahi.conf +EnvironmentFile=-/run/openelec/debug.conf +ExecStart=/usr/lib/bluetooth/bluetoothd $BLUETOOTH_DEBUG +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW +LimitNPROC=1 + +[Install] +WantedBy=bluetooth.target +Alias=dbus-org.bluez.service