Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] dbus: Fix pid file in dbus init script
@ 2012-08-10 19:00 Andy Ross
  2012-08-16 18:30 ` Saul Wold
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Ross @ 2012-08-10 19:00 UTC (permalink / raw)
  To: openembedded-core

The PIDFILE (/var/run/dbus/pid) referenced by /etc/init.d/dbus-1 did
not match the path (/var/run/messagebus.pid) configured in
/etc/dbus-1/system.conf, so the initscript could start the daemon, but
not stop it.  Also remove needless directory ownership logic
(dbus-daemon drops its pid file as root before calling setuid).

Signed-off-by: Andy Ross <andy.ross@windriver.com>
---
 meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init | 11 +++--------
 meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init | 11 +++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
index 4abc4cb..17b58ed 100644
--- a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
+++ b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
@@ -18,9 +18,8 @@ set -e
 
 DAEMON=/usr/bin/dbus-daemon
 NAME=dbus
-DAEMONUSER=messagebus
-PIDDIR=/var/run/dbus
-PIDFILE=$PIDDIR/pid
+DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
+PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
 UUIDDIR=/var/lib/dbus
 DESC="system message bus"
 EVENTDIR=/etc/dbus-1/event.d
@@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
 
 start_it_up()
 {
-  if [ ! -d $PIDDIR ]; then
-    mkdir -p $PIDDIR
-    chown $DAEMONUSER $PIDDIR
-    chgrp $DAEMONUSER $PIDDIR
-  fi
+  mkdir -p "`dirname $PIDFILE`"
   if [ -e $PIDFILE ]; then
     PIDDIR=/proc/$(cat $PIDFILE)
     if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then 
diff --git a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
index 4abc4cb..17b58ed 100644
--- a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
+++ b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
@@ -18,9 +18,8 @@ set -e
 
 DAEMON=/usr/bin/dbus-daemon
 NAME=dbus
-DAEMONUSER=messagebus
-PIDDIR=/var/run/dbus
-PIDFILE=$PIDDIR/pid
+DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
+PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
 UUIDDIR=/var/lib/dbus
 DESC="system message bus"
 EVENTDIR=/etc/dbus-1/event.d
@@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
 
 start_it_up()
 {
-  if [ ! -d $PIDDIR ]; then
-    mkdir -p $PIDDIR
-    chown $DAEMONUSER $PIDDIR
-    chgrp $DAEMONUSER $PIDDIR
-  fi
+  mkdir -p "`dirname $PIDFILE`"
   if [ -e $PIDFILE ]; then
     PIDDIR=/proc/$(cat $PIDFILE)
     if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then 
-- 
1.7.11.2




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

* Re: [PATCH] dbus: Fix pid file in dbus init script
  2012-08-10 19:00 [PATCH] dbus: Fix pid file in dbus init script Andy Ross
@ 2012-08-16 18:30 ` Saul Wold
  0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2012-08-16 18:30 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 08/10/2012 12:00 PM, Andy Ross wrote:
> The PIDFILE (/var/run/dbus/pid) referenced by /etc/init.d/dbus-1 did
> not match the path (/var/run/messagebus.pid) configured in
> /etc/dbus-1/system.conf, so the initscript could start the daemon, but
> not stop it.  Also remove needless directory ownership logic
> (dbus-daemon drops its pid file as root before calling setuid).
>
> Signed-off-by: Andy Ross <andy.ross@windriver.com>
> ---
>   meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init | 11 +++--------
>   meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init | 11 +++--------
>   2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> index 4abc4cb..17b58ed 100644
> --- a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> +++ b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> @@ -18,9 +18,8 @@ set -e
>
>   DAEMON=/usr/bin/dbus-daemon
>   NAME=dbus
> -DAEMONUSER=messagebus
> -PIDDIR=/var/run/dbus
> -PIDFILE=$PIDDIR/pid
> +DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
> +PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
>   UUIDDIR=/var/lib/dbus
>   DESC="system message bus"
>   EVENTDIR=/etc/dbus-1/event.d
> @@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
>
>   start_it_up()
>   {
> -  if [ ! -d $PIDDIR ]; then
> -    mkdir -p $PIDDIR
> -    chown $DAEMONUSER $PIDDIR
> -    chgrp $DAEMONUSER $PIDDIR
> -  fi
> +  mkdir -p "`dirname $PIDFILE`"
>     if [ -e $PIDFILE ]; then
>       PIDDIR=/proc/$(cat $PIDFILE)
>       if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
> diff --git a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> index 4abc4cb..17b58ed 100644
> --- a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> +++ b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> @@ -18,9 +18,8 @@ set -e
>
>   DAEMON=/usr/bin/dbus-daemon
>   NAME=dbus
> -DAEMONUSER=messagebus
> -PIDDIR=/var/run/dbus
> -PIDFILE=$PIDDIR/pid
> +DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
> +PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
>   UUIDDIR=/var/lib/dbus
>   DESC="system message bus"
>   EVENTDIR=/etc/dbus-1/event.d
> @@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
>
>   start_it_up()
>   {
> -  if [ ! -d $PIDDIR ]; then
> -    mkdir -p $PIDDIR
> -    chown $DAEMONUSER $PIDDIR
> -    chgrp $DAEMONUSER $PIDDIR
> -  fi
> +  mkdir -p "`dirname $PIDFILE`"
>     if [ -e $PIDFILE ]; thenOn 08/10/2012 12:00 PM, Andy Ross wrote:> The PIDFILE (/var/run/dbus/pid) referenced by /etc/init.d/dbus-1 did
> not match the path (/var/run/messagebus.pid) configured in
> /etc/dbus-1/system.conf, so the initscript could start the daemon, but
> not stop it.  Also remove needless directory ownership logic
> (dbus-daemon drops its pid file as root before calling setuid).
>
> Signed-off-by: Andy Ross <andy.ross@windriver.com>
> ---
>   meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init | 11 +++--------
>   meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init | 11 +++--------
>   2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> index 4abc4cb..17b58ed 100644
> --- a/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> +++ b/meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init
> @@ -18,9 +18,8 @@ set -e
>
>   DAEMON=/usr/bin/dbus-daemon
>   NAME=dbus
> -DAEMONUSER=messagebus
> -PIDDIR=/var/run/dbus
> -PIDFILE=$PIDDIR/pid
> +DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
> +PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
>   UUIDDIR=/var/lib/dbus
>   DESC="system message bus"
>   EVENTDIR=/etc/dbus-1/event.d
> @@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
>
>   start_it_up()
>   {
> -  if [ ! -d $PIDDIR ]; then
> -    mkdir -p $PIDDIR
> -    chown $DAEMONUSER $PIDDIR
> -    chgrp $DAEMONUSER $PIDDIR
> -  fi
> +  mkdir -p "`dirname $PIDFILE`"
>     if [ -e $PIDFILE ]; then
>       PIDDIR=/proc/$(cat $PIDFILE)
>       if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
> diff --git a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> index 4abc4cb..17b58ed 100644
> --- a/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> +++ b/meta/recipes-core/dbus/dbus-1.5.12/dbus-1.init
> @@ -18,9 +18,8 @@ set -e
>
>   DAEMON=/usr/bin/dbus-daemon
>   NAME=dbus
> -DAEMONUSER=messagebus
> -PIDDIR=/var/run/dbus
> -PIDFILE=$PIDDIR/pid
> +DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
> +PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
>   UUIDDIR=/var/lib/dbus
>   DESC="system message bus"
>   EVENTDIR=/etc/dbus-1/event.d
> @@ -38,11 +37,7 @@ test "$ENABLED" != "0" || exit 0
>
>   start_it_up()
>   {
> -  if [ ! -d $PIDDIR ]; then
> -    mkdir -p $PIDDIR
> -    chown $DAEMONUSER $PIDDIR
> -    chgrp $DAEMONUSER $PIDDIR
> -  fi
> +  mkdir -p "`dirname $PIDFILE`"
>     if [ -e $PIDFILE ]; then
>       PIDDIR=/proc/$(cat $PIDFILE)
>       if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
>
>       PIDDIR=/proc/$(cat $PIDFILE)
>       if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
>

Merged into OE-Core

Thanks
	Sau!




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

end of thread, other threads:[~2012-08-16 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-10 19:00 [PATCH] dbus: Fix pid file in dbus init script Andy Ross
2012-08-16 18:30 ` Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox