#!/bin/sh

exec 2>&1;
. /etc/runit/bin/sv-initialize;


rc1=$1; rc2=$2;
echo "${sv}: $0[$$]: \$@ == $@, rc1 == $rc1, rc2 == $rc2.";

if ! test -e "$DBUS_ENV"; then
	echo "$0: err: not found \"$DBUS_ENV\"";
	exit;
fi

. "$DBUS_ENV";

if ! test -n "$DBUS_SESSION_BUS_PID"; then
	echo "$0: err: not set \"$DBUS_SESSION_BUS_PID";
	exit;
fi

kill "$DBUS_SESSION_BUS_PID";
echo "$0: kill dbus-daemon[$DBUS_SESSION_BUS_PID], rc == $?";

rm -f "$DBUS_ENV";
