From: Seungyoun Ju Date: Thu, 2 Mar 2017 10:35:35 +0000 (+0900) Subject: Modify bluetooth logdump scripts X-Git-Tag: accepted/tizen/4.0/unified/20170816.013919~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-tools.git;a=commitdiff_plain;h=1202382249a668ca9a3a08501ddbdbf7464457a3 Modify bluetooth logdump scripts [Model] COMMON [BinType] AP [Customer] OPEN [Issue#] N/A [Request] Internal [Occurrence Version] N/A [Problem] Bluetooth logdump is not working properly [Cause & Measure] N/A [Checking Method] Turn on Bluetooth and check bluetooth dump tools (e.g. btmon or hcidump). And run *#9900# and check the log. [Team] Basic connection [Developer] Seungyoun Ju [Solution company] Samsung [Change Type] Specification change Change-Id: I949b94fe133b37fdb0701e05816246f4024252e3 --- diff --git a/packaging/bluetooth-force-hci-logger.service b/packaging/bluetooth-force-hci-logger.service new file mode 100644 index 0000000..4d60e6f --- /dev/null +++ b/packaging/bluetooth-force-hci-logger.service @@ -0,0 +1,12 @@ +[Unit] +Description=Service to run BT HCI logger forcefully + +[Service] +Type=oneshot +User=root +Group=root +ExecStart=/usr/etc/bluetooth/bt-run-hci-logger.sh force start hcidump +ExecStop=/usr/etc/bluetooth/bt-run-hci-logger.sh force stop +RemainAfterExit=yes +StandardOutput=journal+console +StandardError=inherit diff --git a/packaging/bluetooth-hci-dump@.service b/packaging/bluetooth-hci-dump@.service new file mode 100644 index 0000000..ebba1a6 --- /dev/null +++ b/packaging/bluetooth-hci-dump@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Service to run BT HCI logdump + +[Service] +User=system +Group=system +Type=oneshot +ExecStart=/usr/etc/bluetooth/bt-hci-logdump.sh %I +StandardOutput=journal+console +StandardError=inherit diff --git a/packaging/bluetooth-hci-logger.service b/packaging/bluetooth-hci-logger.service new file mode 100644 index 0000000..5ca528d --- /dev/null +++ b/packaging/bluetooth-hci-logger.service @@ -0,0 +1,12 @@ +[Unit] +Description=Service to run BT HCI logger normally + +[Service] +Type=oneshot +User=root +Group=root +ExecStart=/usr/etc/bluetooth/bt-run-hci-logger.sh normal start btmon +ExecStop=/usr/etc/bluetooth/bt-run-hci-logger.sh normal stop +RemainAfterExit=yes +StandardOutput=journal+console +StandardError=inherit diff --git a/packaging/bluetooth-tools.spec b/packaging/bluetooth-tools.spec index 1e3846d..e203c09 100644 --- a/packaging/bluetooth-tools.spec +++ b/packaging/bluetooth-tools.spec @@ -73,7 +73,13 @@ export CXXFLAGS+=" -fpie -fvisibility=hidden" export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie" %cmake -%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ +%if 0%{?tizen_build_binary_release_type_eng} + -DBT_HCI_LOG_SIZE=10 +%else + -DBT_HCI_LOG_SIZE=5 +%endif + %__make %{?_smp_mflags} %install @@ -94,6 +100,16 @@ install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt- install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools +install -D -m 0644 packaging/bluetooth-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.service +install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-force-hci-logger.service +install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-dump@.service + +%post +mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ +ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ +ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ + + %files %manifest %{name}.manifest %defattr(-,root,root,-) @@ -105,10 +121,13 @@ install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh -%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh +%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hci-logger.sh %{_datadir}/license/bluetooth-tools %{_unitdir}/multi-user.target.wants/bluetooth-address.service %{_unitdir}/bluetooth-address.service +%{_libdir}/systemd/system/bluetooth-hci-logger.service +%{_libdir}/systemd/system/bluetooth-force-hci-logger.service +%{_libdir}/systemd/system/bluetooth-hci-dump@.service %post profile_common pushd %{_prefix}/etc/bluetooth/ diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bb8a5c0..616753c 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -29,9 +29,12 @@ INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/etc/bluetooth-address DESTINATION / # For All + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bt-run-hci-logger.sh.in ${CMAKE_CURRENT_BINARY_DIR}/bt-run-hci-logger.sh @ONLY) + INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-on.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-dev-up.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-mode-on.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-edutm-off.sh DESTINATION etc/bluetooth) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-hci-logdump.sh DESTINATION etc/bluetooth) -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-run-hcidump.sh DESTINATION etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-run-hci-logger.sh DESTINATION etc/bluetooth) diff --git a/scripts/bt-hci-logdump.sh b/scripts/bt-hci-logdump.sh index a6b56b5..00597d6 100755 --- a/scripts/bt-hci-logdump.sh +++ b/scripts/bt-hci-logdump.sh @@ -1,22 +1,112 @@ #!/bin/sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin #-------------------------------------- # bluetooth hci #-------------------------------------- +CHOWN="/bin/chown" + +eval $(tzplatform-get TZ_USER_DOWNLOADS) + +DUMP_BASE_DIR=$1 BLUETOOTH_DEBUG=${1}/bluetooth + PREV_PWD=${PWD} -BT_DUMP_DIR=/opt/usr/media/Others/.bt_dump +#BT_DUMP_DIR=${TZ_USER_DOWNLOADS}/.bt_dump +BT_DUMP_DIR=/opt/usr/media/Downloads/.bt_dump + +if [ "$1" = "syslog" ] +then + DUMP_BASE_DIR=${BT_DUMP_DIR} + BLUETOOTH_DEBUG=${DUMP_BASE_DIR}/bluetooth +fi + +BT_DUMP_TMP_DIR=/tmp/bt_dump +LOG_FILE="bt_hcidump.log" + +process_btdump() +{ + if [ -e btmon.log.1 -a -e btmon.log ] + then + /usr/bin/tail -c +17 btmon.log > btmon.log_bin + /bin/cat btmon.log.1 btmon.log_bin > final.log + /usr/bin/btsnoop -s final.log + if [ $? -eq 0 ] + then + /bin/rm -f btmon.log_bin btmon.log.1 btmon.log final.log + LOG_FILE="btsnoop_*.log" + else + /bin/rm -f btmon.log_bin btmon.log.1 btmon.log + /bin/mv final.log btmon.log + LOG_FILE="" + fi + elif [ -e bt_hcidump.log.1 -a -e bt_hcidump.log ] + then + /usr/bin/tail -c +17 bt_hcidump.log > bt_hcidump.log_bin + /bin/cat bt_hcidump.log.1 bt_hcidump.log_bin > bt_hcidump.log + /bin/rm -f bt_hcidump.log_bin bt_hcidump.log.1 + elif [ -e btmon.log ] + then + /usr/bin/btsnoop -s btmon.log + if [ $? -eq 0 ] + then + /bin/rm -f btmon.log + LOG_FILE="btsnoop_*.log" + else + LOG_FILE="" + fi + fi + + if [ "${LOG_FILE}a" != "a" ] + then + /usr/bin/rename .log .cfa ${LOG_FILE} + fi +} if [ ! -e ${BT_DUMP_DIR} ] then + if [ "$1" = "syslog" ] + then + /bin/mkdir -p ${BT_DUMP_DIR} + /bin/chown 200:200 ${BT_DUMP_DIR} + else + exit 0 + fi +fi + +if [ "$1" = "syslog" ] +then + cp /var/log/messages ${BT_DUMP_DIR}/messages_`date "+%b_%d_%H:%M:%S_%Y"` + cp /var/log/messages.0 ${BT_DUMP_DIR}/messages.0_`date "+%b_%d_%H:%M:%S_%Y"` + # Skip the orginal bt_dump extract part exit 0 fi +if [ ${DUMP_BASE_DIR} ] +then + cd ${DUMP_BASE_DIR} +fi + /bin/mkdir -p ${BLUETOOTH_DEBUG} +${CHOWN} 200:200 ${BLUETOOTH_DEBUG} + +/bin/mkdir -p ${BT_DUMP_TMP_DIR} +/bin/cp -rf ${BT_DUMP_DIR}/* ${BT_DUMP_TMP_DIR} + +cd ${BT_DUMP_TMP_DIR} +process_btdump + +if [ -e "${BT_DUMP_TMP_DIR}/old_hcidump" ] +then + cd ${BT_DUMP_TMP_DIR}/old_hcidump + process_btdump +fi + +cd ${BT_DUMP_TMP_DIR} +/bin/tar czf ${BLUETOOTH_DEBUG}/bt_dump.tar.gz * -cd ${BT_DUMP_DIR} -/bin/tar -cvzf ${BLUETOOTH_DEBUG}/bt_dump.tar.gz * +cd ${BLUETOOTH_DEBUG} +${CHOWN} 200:200 ${BLUETOOTH_DEBUG}/bt_dump.tar.gz +/bin/rm -rf ${BT_DUMP_TMP_DIR} cd ${PREV_PWD} diff --git a/scripts/bt-run-hci-logger.sh.in b/scripts/bt-run-hci-logger.sh.in new file mode 100644 index 0000000..30bb7da --- /dev/null +++ b/scripts/bt-run-hci-logger.sh.in @@ -0,0 +1,154 @@ +#!/bin/sh + +MKDIR="/bin/mkdir" +CP="/bin/cp" +RM="/bin/rm" +MV="/bin/mv" +DATE="/bin/date" +GREP="/bin/grep" +CUT="/usr/bin/cut" +PGREP="/usr/bin/pgrep" +BTMON="/usr/bin/btmon" +HCIDUMP="/usr/bin/hcidump" +CHOWN="/bin/chown" + +eval $(tzplatform-get TZ_USER_DOWNLOADS) + +# When *#9900# is typed, this is executed to archive logs. +LOGDUMP_DIR="/opt/etc/dump.d/module.d" +LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh" + +# BT HCI Log is saved here +#LOG_BASEDIR=${TZ_USER_DOWNLOADS} +LOG_BASEDIR=/opt/usr/media/Downloads +LOG_DIR="${LOG_BASEDIR}/.bt_dump" + +HCIDUMP_LOG_FILENAME="bt_hcidump.log" +BTMON_LOG_FILENAME="btmon.log" + +HCIDUMP_LOG_PATH="${LOG_DIR}/${HCIDUMP_LOG_FILENAME}" +BTMON_LOG_PATH="${LOG_DIR}/${BTMON_LOG_FILENAME}" +TMP_PID_FILE="/tmp/.bt_hci_logger.pid" + +DUMP_SIZE=@BT_HCI_LOG_SIZE@ + +## Step 1. Check debug mode and force configuration +debug_mode=`/bin/cat /sys/module/sec_debug/parameters/enable` +debug_mode_user=`/bin/cat /sys/module/sec_debug/parameters/enable_user` + +case "$1" in + force) +# Re-initialize the log directory for force mode + LOG_DIR="${LOG_DIR}/force" + HCIDUMP_LOG_PATH="${LOG_DIR}/${HCIDUMP_LOG_FILENAME}" + BTMON_LOG_PATH="${LOG_DIR}/${BTMON_LOG_FILENAME}" + TMP_PID_FILE="/tmp/.bt_hci_force_logger.pid" + ;; + normal) + if [ ${debug_mode} != '1' -a ${debug_mode_user} != '1' ] + then + if [ -e ${LOG_DIR} ] + then + ${RM} -rf ${LOG_DIR} + fi + + if [ ! -e ${TMP_PID_FILE} ] + then + exit 0 + fi + + bt_hci_logger_pid=`cat ${TMP_PID_FILE}` + kill $bt_hci_logger_pid + ${RM} -f ${TMP_PID_FILE} + exit 0 + fi + ;; + *) + echo "Usage : bt-run-hci-logger.sh {force | normal} {start | stop} {hcidump | btmon} [keep_old_dump]" + exit 255 + ;; +esac + +## Step 2. Check start / stop parameter +case "$2" in + start) + ;; + stop) + if [ ! -e ${TMP_PID_FILE} ] + then + exit 0 + fi + + bt_hci_logger_pid=`cat ${TMP_PID_FILE}` + kill $bt_hci_logger_pid + ${RM} -f ${TMP_PID_FILE} + exit 0 + ;; + *) + echo "Usage : bt-run-hci-logger.sh {force | normal} {start | stop} {hcidump | btmon} [keep_old_dump]" + exit 255 + ;; +esac + +## Step 3. Configure log tool +case "$3" in + hcidump) + LOG_TOOL=${HCIDUMP} + LOG_PATH=${HCIDUMP_LOG_PATH} + LOG_OPT_END="-c 2 -s ${DUMP_SIZE}" + ;; + btmon) + BTMON_DUMP_SIZE=`expr ${DUMP_SIZE} \* 1000000` + LOG_TOOL=${BTMON} + LOG_PATH=${BTMON_LOG_PATH} + LOG_OPT_END="-C 2 -W ${BTMON_DUMP_SIZE}" + ;; + *) + echo "Usage : bt-run-hci-logger.sh {force | normal} {start | stop} {hcidump | btmon} [keep_old_dump]" + exit 255 + ;; +esac + +## Step 4. Configure keep_old_dump option +case "$4" in + keep_old_dump) + KEEP_OLD_DUMP=1 + LOG_PATH="${LOG_PATH}_`${DATE} +%s_%N`" + ;; + *) + KEEP_OLD_DUMP=0 + ;; +esac + +## Step 5. Copy a log archive script for all_log_dump.sh +if [ ! -e ${LOGDUMP_PATH} ] +then + ${MKDIR} -p ${LOGDUMP_DIR} + ${CP} -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH} +fi + +## Step 6. Check logging base directory +# If it doesn't exist, exit +if [ ! -e ${LOG_BASEDIR} ] +then + exit 0 +fi + +## Step 7. Backup old log and Start logging +if [ ! -e ${LOG_DIR}/old_hcidump ] +then + ${MKDIR} -p ${LOG_DIR}/old_hcidump + #Make system owner/group to allow systemd.service logging service + ${CHOWN} -R 200:200 ${LOG_DIR} +fi + +if [ ${KEEP_OLD_DUMP} = '0' ] +then + ${RM} -f ${LOG_DIR}/old_hcidump/* +fi + +${MV} ${LOG_DIR}/*.log* ${LOG_DIR}/old_hcidump/;\ +${LOG_TOOL} -w ${LOG_PATH} ${LOG_OPT_END} > /dev/null & +echo $! > ${TMP_PID_FILE} + +exit 0 diff --git a/scripts/bt-run-hcidump.sh b/scripts/bt-run-hcidump.sh deleted file mode 100755 index 9605c67..0000000 --- a/scripts/bt-run-hcidump.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -HCIDUMP_BASEDIR="/opt/usr/media/Others" -HCIDUMP_DIR="${HCIDUMP_BASEDIR}/.bt_dump" -HCIDUMP_FILENAME="bt_hcidump.log" -HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}" - -LOGDUMP_DIR="/opt/etc/dump.d/module.d" -LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh" - -debug_mode=`/bin/cat /sys/module/sec_debug/parameters/enable` -debug_mode_user=`/bin/cat /sys/module/sec_debug/parameters/enable_user` - -if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ] -then - if [ -e /usr/sbin/hcidump ] - then - # When *#9900# is typed, this is executed to archive logs. - /bin/mkdir -p ${LOGDUMP_DIR} - /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH} - - # Create base directory as proper owner and smack rule - # if it doesn't exist - if [ ! -e ${HCIDUMP_BASEDIR} ] - then - /bin/mkdir - p ${HCIDUMP_BASEDIR} - /bin/chown 5000:5000 ${HCIDUMP_BASEDIR} - /usr/bin/chsmack -t -a 'system::media' ${HCIDUMP_BASEDIR} - fi - /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump - /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/* - /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/ - /usr/sbin/hcidump -w ${HCIDUMP_PATH} & - fi -elif [ -e ${HCIDUMP_DIR} ] -then - /bin/rm -rf ${HCIDUMP_DIR} -fi diff --git a/scripts/mobile/bt-stack-down-with-radio.sh b/scripts/mobile/bt-stack-down-with-radio.sh index 801481c..664b063 100755 --- a/scripts/mobile/bt-stack-down-with-radio.sh +++ b/scripts/mobile/bt-stack-down-with-radio.sh @@ -8,6 +8,9 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin # If radio is on, should not call the device down script #/usr/etc/bluetooth/bt-dev-end.sh +# Stop HCI logging +systemctl stop bluetooth-hci-logger.service + # Kill BlueZ bluetooth stack killall obexd obex-client killall bt-syspopup diff --git a/scripts/mobile/bt-stack-down.sh b/scripts/mobile/bt-stack-down.sh old mode 100755 new mode 100644 index 4771cd3..1415d58 --- a/scripts/mobile/bt-stack-down.sh +++ b/scripts/mobile/bt-stack-down.sh @@ -8,6 +8,9 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin # Remove BT device /usr/etc/bluetooth/bt-dev-end.sh +# Stop HCI logging +systemctl stop bluetooth-hci-logger.service + # Kill BlueZ bluetooth stack killall obexd obex-client killall bt-syspopup diff --git a/scripts/mobile/bt-stack-up.sh b/scripts/mobile/bt-stack-up.sh old mode 100755 new mode 100644 index 9e4587b..3b144b2 --- a/scripts/mobile/bt-stack-up.sh +++ b/scripts/mobile/bt-stack-up.sh @@ -5,11 +5,15 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin # Script for executing Bluetooth stack # +# Start HCI logging +systemctl start bluetooth-hci-logger.service + # Register BT Device /usr/etc/bluetooth/bt-dev-start.sh if !(/usr/bin/hciconfig | grep hci); then echo "Registering BT device is failed." + systemctl stop bluetooth-hci-logger.service exit 1 fi diff --git a/scripts/wearable/bt-stack-down.sh b/scripts/wearable/bt-stack-down.sh index 506df8a..7bbcd1e 100755 --- a/scripts/wearable/bt-stack-down.sh +++ b/scripts/wearable/bt-stack-down.sh @@ -8,6 +8,9 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin # Remove BT device /usr/etc/bluetooth/bt-dev-end.sh +# Stop HCI logging +systemctl stop bluetooth-hci-logger.service + # Kill BlueZ bluetooth stack killall obexd obex-client killall bluetooth-pb-agent diff --git a/scripts/wearable/bt-stack-up.sh b/scripts/wearable/bt-stack-up.sh index 50d35bb..1116e6b 100755 --- a/scripts/wearable/bt-stack-up.sh +++ b/scripts/wearable/bt-stack-up.sh @@ -1,11 +1,6 @@ #!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin -HCIDUMP_DIR="/opt/usr/media/.bluetooth" -HCIDUMP_FILENAME="bt_hcidump.log" -HCIDUMP_PATH="${HCIDUMP_DIR}/${HCIDUMP_FILENAME}" -LOGDUMP_DIR="/opt/etc/dump.d/module.d" -LOGDUMP_PATH="${LOGDUMP_DIR}/bt-hci-logdump.sh" RFKILL=/usr/sbin/rfkill GREP=/usr/bin/grep HFP_HF=hfp_hf @@ -30,41 +25,20 @@ fi # Script for executing Bluetooth stack # +# Start HCI logging +systemctl start bluetooth-hci-logger.service + # Register BT Device /usr/etc/bluetooth/bt-dev-start.sh if !(/usr/bin/hciconfig | grep hci); then echo "Registering BT device is failed." + systemctl stop bluetooth-hci-logger.service exit 1 fi -debug_mode=`cat /sys/module/sec_debug/parameters/enable` -debug_mode_user=`cat /sys/module/sec_debug/parameters/enable_user` - -if [ ${debug_mode} = '1' -o ${debug_mode_user} = '1' ] -then - if [ -e /usr/sbin/hcidump ] - then - # When *#9900# is typed, this is executed to archive logs. # - /bin/mkdir -p ${LOGDUMP_DIR} - /bin/cp -f /usr/etc/bluetooth/bt-hci-logdump.sh ${LOGDUMP_PATH} - - /bin/mkdir -p ${HCIDUMP_DIR}/old_hcidump - /bin/rm -f ${HCIDUMP_DIR}/old_hcidump/* - /bin/mv ${HCIDUMP_PATH}* ${HCIDUMP_DIR}/old_hcidump/ - /usr/sbin/hcidump -w ${HCIDUMP_PATH} & - fi -elif [ -e ${HCIDUMP_DIR} ] -then - /bin/rm -rf ${HCIDUMP_DIR} -fi - # Execute BlueZ BT stack echo "Run bluetoothd" /usr/libexec/bluetooth/bluetoothd -d -C & -/usr/bin/dbus-send --print-reply --system --type=method_call \ - --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \ - org.freedesktop.systemd1.Manager.StartUnit \ - string:'wms.service' string:'fail' exit 0