Update systemd patch to make it possible to disable bluez

This commit is contained in:
Lennart Poettering 2011-04-07 00:29:06 +02:00
parent c6457331f6
commit edfdc35076
2 changed files with 29 additions and 17 deletions

View File

@ -1,7 +1,7 @@
From d205c2e05061a3f3502cccd0b157348cdc6e1071 Mon Sep 17 00:00:00 2001
From 22c938523708fab4afa67608461c103a663fd21c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 21 Jul 2010 19:20:44 +0200
Subject: [PATCH 2/3] systemd: install systemd unit files
Subject: [PATCH] systemd: install systemd unit files
This also enables bus activation for bluetoothd, but only if systemd is
running. Only if that's the case we can make sure in a race-free fashion
@ -10,18 +10,18 @@ that bluetoothd is not started twice at the same time.
Makefile.am | 21 ++++++++++++++++++---
configure.ac | 9 +++++++++
scripts/.gitignore | 1 +
scripts/bluetooth.service.in | 12 ++++++++++++
scripts/bluetooth.service.in | 13 +++++++++++++
scripts/org.bluez.service | 5 +++++
5 files changed, 45 insertions(+), 3 deletions(-)
5 files changed, 46 insertions(+), 3 deletions(-)
create mode 100644 scripts/.gitignore
create mode 100644 scripts/bluetooth.service.in
create mode 100644 scripts/org.bluez.service
diff --git a/Makefile.am b/Makefile.am
index 6044082..3ed5bcc 100644
index 4670886..8a844bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -346,7 +346,8 @@ endif
@@ -352,7 +352,8 @@ endif
CLEANFILES += $(rules_DATA)
EXTRA_DIST += scripts/bluetooth.rules \
@ -31,7 +31,7 @@ index 6044082..3ed5bcc 100644
if PCMCIA
udevdir = $(libexecdir)/udev
@@ -354,6 +355,20 @@ udevdir = $(libexecdir)/udev
@@ -360,6 +361,20 @@ udevdir = $(libexecdir)/udev
dist_udev_SCRIPTS = scripts/bluetooth_serial
endif
@ -52,7 +52,7 @@ index 6044082..3ed5bcc 100644
EXTRA_DIST += doc/manager-api.txt \
doc/adapter-api.txt doc/device-api.txt \
doc/service-api.txt doc/agent-api.txt doc/attribute-api.txt \
@@ -378,9 +393,9 @@ pkgconfigdir = $(libdir)/pkgconfig
@@ -385,9 +400,9 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = bluez.pc
@ -65,7 +65,7 @@ index 6044082..3ed5bcc 100644
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure config.h.in config.sub config.guess \
diff --git a/configure.ac b/configure.ac
index b4c2482..a807830 100644
index 1ecdc7b..ddb62ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,5 +56,14 @@ if (test "${enable_capng}" = "yes"); then
@ -92,10 +92,10 @@ index 0000000..4b9f765
+bluetooth.service
diff --git a/scripts/bluetooth.service.in b/scripts/bluetooth.service.in
new file mode 100644
index 0000000..f95b0b0
index 0000000..d0089ea
--- /dev/null
+++ b/scripts/bluetooth.service.in
@@ -0,0 +1,12 @@
@@ -0,0 +1,13 @@
+[Unit]
+Description=Bluetooth Manager
+After=syslog.target
@ -108,9 +108,10 @@ index 0000000..f95b0b0
+
+[Install]
+WantedBy=bluetooth.target
+Alias=dbus-org.bluez.service
diff --git a/scripts/org.bluez.service b/scripts/org.bluez.service
new file mode 100644
index 0000000..2a3b057
index 0000000..dd7ae8f
--- /dev/null
+++ b/scripts/org.bluez.service
@@ -0,0 +1,5 @@
@ -118,7 +119,7 @@ index 0000000..2a3b057
+Name=org.bluez
+Exec=/bin/false
+User=root
+SystemdService=bluetooth.service
+SystemdService=dbus-org.bluez.service
--
1.7.3.2
1.7.4.1

View File

@ -1,7 +1,7 @@
Summary: Bluetooth utilities
Name: bluez
Version: 4.90
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: Applications/System
Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
@ -185,7 +185,7 @@ fi
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl disable bluetooth.service >/dev/null 2>&1 || :
/bin/systemctl --no-reload disable bluetooth.service >/dev/null 2>&1 || :
/bin/systemctl stop bluetooth.service >/dev/null 2>&1 || :
fi
@ -196,10 +196,18 @@ if [ $1 -ge 1 ] ; then
fi
%triggerun -- bluez < 4.71-2
if /sbin/chkconfig bluetooth ; then
if /sbin/chkconfig --level 3 bluetooth ; then
/bin/systemctl enable bluetooth.service >/dev/null 2>&1 || :
fi
%triggerun -- bluez < 4.87-3
if /bin/systemctl is-enabled bluetooth.service >/dev/null 2>&1 ; then
# Starting with bluez 4.87-3 the D-Bus symlink is required to
# make bus activation work. Let's add it in, in case bluez was
# enabled already.
ln -s /lib/systemd/system/bluetooth.service /etc/systemd/system/dbus-org.bluez.service >/dev/null 2>&1 || :
fi
%post compat
/sbin/chkconfig --add dund
/sbin/chkconfig --add pand
@ -288,6 +296,9 @@ fi
%{_mandir}/man1/pand.1.gz
%changelog
* Thu Apr 7 2011 Lennart Poettering <lpoetter@redhat.com> - 4.90-2
- Update systemd patch to make it possible to disable bluez
* Thu Mar 17 2011 Bastien Nocera <bnocera@redhat.com> 4.90-1
- Update to 4.90