All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] dbus: Fix pid file in dbus init script
Date: Thu, 16 Aug 2012 11:30:33 -0700	[thread overview]
Message-ID: <502D3C49.9080509@linux.intel.com> (raw)
In-Reply-To: <1344625241-15300-1-git-send-email-andy.ross@windriver.com>

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!




      reply	other threads:[~2012-08-16 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 19:00 [PATCH] dbus: Fix pid file in dbus init script Andy Ross
2012-08-16 18:30 ` Saul Wold [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502D3C49.9080509@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.