summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortony <tony@tony-OptiPlex-790.(none)>2014-08-19 17:01:52 +0800
committerchunqiangx <chunqiangx.tang@intel.com>2014-08-20 11:09:14 +0800
commit1c8d2946202e474b600d162094d3e47d6e323790 (patch)
tree616566989af39b84565c4a35b38baabdf14dae0c
parent0dfedac753df2f7b065b4d7902e11bf6cf13c55c (diff)
downloadbluez-1c8d2946202e474b600d162094d3e47d6e323790.tar.gz
bluez-1c8d2946202e474b600d162094d3e47d6e323790.tar.bz2
bluez-1c8d2946202e474b600d162094d3e47d6e323790.zip
fix obex systemd service to support multiusersubmit/tizen/20140822.031654accepted/tizen/ivi/20140902.081022
This created obex root directory before runing obexd if the directory does not exist. Adding a shell script to handle this. Bug-Tizen: TC-1436 Change-Id: I84d678b738c1ebca8966f4bbe123004a4d38e9bb Signed-off-by: chunqiangx <chunqiangx.tang@intel.com>
-rw-r--r--obexd/src/obex.service.in3
-rw-r--r--packaging/bluez.spec3
-rwxr-xr-xpackaging/obex.sh17
3 files changed, 21 insertions, 2 deletions
diff --git a/obexd/src/obex.service.in b/obexd/src/obex.service.in
index b381be2c..217d7abb 100644
--- a/obexd/src/obex.service.in
+++ b/obexd/src/obex.service.in
@@ -4,8 +4,7 @@ Description=Bluetooth OBEX service
[Service]
Type=dbus
BusName=org.bluez.obex
-ExecStartPre=/bin/sh -c 'if [ ! -d $HOME/content ] ; then /bin/mkdir -p $HOME/content ; fi'
-ExecStart=/bin/sh -c 'if [ -z `ps ax | grep -v grep | grep obexd` ] ; then exec /lib/bluetooth/obexd -d --noplugin=syncevolution,pcsuite,irmc --symlinks --root=$HOME/content ; fi'
+ExecStart=/bin/obex.sh
[Install]
Alias=dbus-org.bluez.obex.service
diff --git a/packaging/bluez.spec b/packaging/bluez.spec
index 43e64b63..e251d9de 100644
--- a/packaging/bluez.spec
+++ b/packaging/bluez.spec
@@ -34,6 +34,7 @@ Source5: baselibs.conf
Source7: bluetooth.modprobe
Source101: obex-root-setup
Source102: create-symlinks
+Source103: obex.sh
Source1001: bluez.manifest
%define cups_lib_dir %{_prefix}/lib/cups
@@ -129,6 +130,7 @@ install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
+install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh
install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
@@ -195,6 +197,7 @@ install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
%{_datadir}/dbus-1/services/org.bluez.obex.service
%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
%{_bindir}/obex-root-setup
+%{_bindir}/obex.sh
%files test
%manifest %{name}.manifest
diff --git a/packaging/obex.sh b/packaging/obex.sh
new file mode 100755
index 00000000..884abde8
--- /dev/null
+++ b/packaging/obex.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This script has to be launched by systemd obex service.
+# It was separated from the systemd service to check
+# the presence of obex root directory. If the directory
+# does not exist, then create it.
+if [ ! -z `ps ax | grep -v grep | grep obexd` ];
+then return
+fi
+
+eval $(tzplatform-get TZ_USER_CONTENT);
+
+if [ ! -d $TZ_USER_CONTENT ];
+then mkdir -p $TZ_USER_CONTENT;
+fi
+
+exec /lib/bluetooth/obexd -d --noplugin=syncevolution,pcsuite,irmc --symlinks -r $TZ_USER_CONTENT;
+