Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
set -o errexit
set -o nounset
if [[ ${#} -ne 1 ]]
echo "Usage: ${0} upstart-conf-file" >&2
exit 1
config=${1} && shift
exec 4<> ${dbus_pid_file}
exec 6<> ${dbus_add_file}
/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
function clean {
kill $(cat ${dbus_pid_file})
rm -f ${dbus_pid_file} ${dbus_add_file}
exit 1
trap "{ clean; }" EXIT
export DBUS_SESSION_BUS_ADDRESS=$(cat ${dbus_add_file})
/bin/init-checkconf ${config}
Copy link

learntoswim commented Jan 22, 2014

Very helpful. Thanks!

Copy link

bool-dev commented Jan 31, 2014


Copy link

aguynamedben commented Feb 8, 2014

Copy link

stuthedew commented Jun 8, 2015

Thank you!

Copy link

istvanfazakas commented Aug 20, 2015


Copy link

guss77 commented Nov 4, 2015


Copy link

franz-josef-kaiser commented Jan 19, 2016

Problem only appears when the DISPLAY is not set. Example quick fix:

export DISPLAY=:0
init-checkconf -d /etc/init/your-service.conf

Copy link

alexdunae commented May 13, 2017

Thank you! You bailed me out on a Friday night.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment