Skip to contentSkip to conversation

bluez5: Fix status subcommand of init script

PATCH In review David Frey 2 participants 4 messages Dec 27, 2018 – Jan 8, 2019

lore
Share & tools
lore

David Frey

author
#0 lore raw

PATCH 1/1 bluez5: Fix status subcommand of init script

Update the bluez5 init script to resolve an issue where the status subcommand would exit without printing any message if bluez was not running. The early exit was caused by the fact that the init script has "set -e". When "pidof ${DAEMON} >/dev/null" is executed, the script terminates immediately if bluez isn't running because pidof returns a non-zero result. The fixed version does not suffer from this issue and makes use of the "status" function from the functions library.

---
 meta/recipes-connectivity/bluez5/bluez5/init | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
meta/recipes-connectivity/bluez5/bluez5/init +4 -8
index d7972f2d95..ca9fa18549 100644
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+# Source function library
+. /etc/init.d/functions
+
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DESC=bluetooth
 
@@ -44,14 +47,7 @@ case $1 in
 	$0 start
   ;;
   status)
-	 pidof ${DAEMON} >/dev/null
-	 status=$?
-        if [ $status -eq 0 ]; then
-                 echo "bluetooth is running."
-        else
-                echo "bluetooth is not running"
-        fi
-        exit $status
+	status ${DAEMON} || exit $?
    ;;
    *)
 	N=/etc/init.d/bluetooth
Signature · 1 line
2.11.0
author
#1 lore raw

Hi,

This is my first time submitting a patch to this mailing list. It has been 12 days and I haven't received any response or acknowledgement. If there is a problem with the patch that I submitted, please let me know.

Thanks,
David

#2 lore raw

The patch should be sent to openembedded-core list.

http://lists.openembedded.org/mailman/listinfo/openembedded-core

Alex

Quoted 14 lines · David Frey

Hi,

This is my first time submitting a patch to this mailing list. It has been 12 days and I haven't received any response or acknowledgement. If there is a problem with the patch that I submitted, please let me know.

Thanks,
David
--
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

author
#3 lore raw

Thanks Alex. I will submit the patch to openembedded-core.

Quoted 21 lines · Alexander Kanavin

The patch should be sent to openembedded-core list.

http://lists.openembedded.org/mailman/listinfo/openembedded-core

Alex

Quoted 14 lines · David Frey

Hi,

This is my first time submitting a patch to this mailing list. It has been 12 days and I haven't received any response or acknowledgement. If there is a problem with the patch that I submitted, please let me know.

Thanks,
David
--
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky