All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluez5: Fix status subcommand of init script
@ 2018-12-27 15:47 David Frey
  2019-01-08 17:14 ` David Frey
  0 siblings, 1 reply; 5+ messages in thread
From: David Frey @ 2018-12-27 15:47 UTC (permalink / raw)
  To: poky

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.

Signed-off-by: David Frey <dpfrey@gmail.com>
---
 meta/recipes-connectivity/bluez5/bluez5/init | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-connectivity/bluez5/bluez5/init b/meta/recipes-connectivity/bluez5/bluez5/init
index d7972f2d95..ca9fa18549 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/init
+++ b/meta/recipes-connectivity/bluez5/bluez5/init
@@ -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
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] bluez5: Fix status subcommand of init script
  2018-12-27 15:47 David Frey
@ 2019-01-08 17:14 ` David Frey
  2019-01-08 17:32   ` Alexander Kanavin
  0 siblings, 1 reply; 5+ messages in thread
From: David Frey @ 2019-01-08 17:14 UTC (permalink / raw)
  To: poky

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] bluez5: Fix status subcommand of init script
  2019-01-08 17:14 ` David Frey
@ 2019-01-08 17:32   ` Alexander Kanavin
  2019-01-08 18:39     ` David Frey
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2019-01-08 17:32 UTC (permalink / raw)
  To: David Frey; +Cc: Poky Project

The patch should be sent to openembedded-core list.

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

Alex

On Tue, 8 Jan 2019 at 18:15, David Frey <dpfrey@gmail.com> wrote:
>
> 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
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] bluez5: Fix status subcommand of init script
  2019-01-08 17:32   ` Alexander Kanavin
@ 2019-01-08 18:39     ` David Frey
  0 siblings, 0 replies; 5+ messages in thread
From: David Frey @ 2019-01-08 18:39 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Poky Project

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

On 1/8/2019 9:32 AM, Alexander Kanavin wrote:
> The patch should be sent to openembedded-core list.
> 
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> Alex
> 
> On Tue, 8 Jan 2019 at 18:15, David Frey <dpfrey@gmail.com> wrote:
>>
>> 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
>> poky@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/poky



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] bluez5: Fix status subcommand of init script
@ 2019-01-10 19:23 David Frey
  0 siblings, 0 replies; 5+ messages in thread
From: David Frey @ 2019-01-10 19:23 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: David Frey <dpfrey@gmail.com>
---
 meta/recipes-connectivity/bluez5/bluez5/init | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-connectivity/bluez5/bluez5/init b/meta/recipes-connectivity/bluez5/bluez5/init
index d7972f2d95..ca9fa18549 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/init
+++ b/meta/recipes-connectivity/bluez5/bluez5/init
@@ -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
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-10 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-10 19:23 [PATCH] bluez5: Fix status subcommand of init script David Frey
  -- strict thread matches above, loose matches on Subject: below --
2018-12-27 15:47 David Frey
2019-01-08 17:14 ` David Frey
2019-01-08 17:32   ` Alexander Kanavin
2019-01-08 18:39     ` David Frey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.