From 2efa5c70150e34f66c12a494c3c003f56976c1c7 Mon Sep 17 00:00:00 2001 From: kremlin Date: Mon, 2 Jun 2014 17:38:44 -0500 Subject: [PATCH] added scripts to place config files, added a note in source about that --- hacks/hostnamed-dbus.conf | 10 ++++++++++ hacks/punch_config.sh | 8 ++++++++ hacks/unpunch_config.sh | 7 +++++++ src/interfaces/hostnamed/hostnamed.c | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 hacks/hostnamed-dbus.conf create mode 100755 hacks/punch_config.sh create mode 100755 hacks/unpunch_config.sh diff --git a/hacks/hostnamed-dbus.conf b/hacks/hostnamed-dbus.conf new file mode 100644 index 0000000..c84c0f3 --- /dev/null +++ b/hacks/hostnamed-dbus.conf @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/hacks/punch_config.sh b/hacks/punch_config.sh new file mode 100755 index 0000000..611250d --- /dev/null +++ b/hacks/punch_config.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# sticks our config for hostnamed (which needs to use the system bus) +# in place. and restarts dbus-daemon will be replaced by a more elegant, +# not-hack in the future + +cp $(dirname "$(readlink -f "$0")")/hostnamed-dbus.conf /etc/dbus-1/system.d/hostnamed-dbus.conf +/etc/rc.d/dbus_daemon reload >> /dev/null diff --git a/hacks/unpunch_config.sh b/hacks/unpunch_config.sh new file mode 100755 index 0000000..076c353 --- /dev/null +++ b/hacks/unpunch_config.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# unsticks our config for hostnamed (which needs to use the system bus) +# and restarts dbus + +rm /etc/dbus-1/system.d/hostnamed-dbus.conf +/etc/rc.d/dbus_daemon reload >> /dev/null diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 114ad10..4b326a1 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -84,7 +84,6 @@ static void on_bus_acquired(GDBusConnection *conn, NULL, NULL, NULL); - g_assert(reg_id > 0); } static void on_name_acquired(GDBusConnection *conn, @@ -99,6 +98,7 @@ static void on_name_lost(GDBusConnection *conn, gpointer user_data) { g_print("lost name %s, exiting...\n", name); + g_print("you might need to run hacks/punch_config.sh\n"); g_main_loop_quit(loop); } -- 2.41.0