aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkremlin <ian@kremlin.cc>2014-06-03 06:38:44 +0800
committerkremlin <ian@kremlin.cc>2014-06-03 06:38:44 +0800
commit2efa5c70150e34f66c12a494c3c003f56976c1c7 (patch)
treec8aaa590774d26434a81639b4ac6c90822c4963a
parent6de394d4129d558807da8d52bc736494ccfbb387 (diff)
downloadsystembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar.gz
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar.bz2
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar.lz
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar.xz
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.tar.zst
systembsd-2efa5c70150e34f66c12a494c3c003f56976c1c7.zip
added scripts to place config files, added a note in source about that
-rw-r--r--hacks/hostnamed-dbus.conf10
-rwxr-xr-xhacks/punch_config.sh8
-rwxr-xr-xhacks/unpunch_config.sh7
-rw-r--r--src/interfaces/hostnamed/hostnamed.c2
4 files changed, 26 insertions, 1 deletions
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 @@
+<!-- if i am in /etc/dbus-1/system.d/ you should probably delete me immediately -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy context="default">
+ <allow own="org.freedesktop.hostname1"/>
+ <allow send_destination="org.freedesktop.hostname1"/>
+ <allow receive_sender="org.freedesktop.hostname1"/>
+ </policy>
+</busconfig>
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);
}