diff options
author | Andy Ross <andy.ross@windriver.com> | 2012-08-10 12:00:41 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-15 14:25:50 +0100 |
commit | 23cfbff5611c2ed52eedfaa99b1d6eccd326f035 (patch) | |
tree | 33c03e327b2b6d90a1281274336b437934ed92e3 | |
parent | 9bc0ca9369d0daee94abf60d3d521cc734c7e8cd (diff) | |
download | openembedded-core-23cfbff5611c2ed52eedfaa99b1d6eccd326f035.tar.gz openembedded-core-23cfbff5611c2ed52eedfaa99b1d6eccd326f035.tar.bz2 openembedded-core-23cfbff5611c2ed52eedfaa99b1d6eccd326f035.zip |
dbus: Fix pid file in dbus init script
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>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r-- | meta/recipes-core/dbus/dbus-1.4.20/dbus-1.init | 11 | ||||
-rw-r--r-- | 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 4abc4cbf73..17b58ed18f 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 4abc4cbf73..17b58ed18f 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 |