Created
December 11, 2012 07:04
-
-
Save whiteley/4256487 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
if [[ ${#} -ne 1 ]] | |
then | |
echo "Usage: ${0} upstart-conf-file" >&2 | |
exit 1 | |
fi | |
config=${1} && shift | |
dbus_pid_file=$(/bin/mktemp) | |
exec 4<> ${dbus_pid_file} | |
dbus_add_file=$(/bin/mktemp) | |
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} |
Thank you!
👍
👍
Problem only appears when the DISPLAY
is not set. Example quick fix:
export DISPLAY=:0
init-checkconf -d /etc/init/your-service.conf
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
✨