summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2009-06-12 11:10:06 +0100
committerDavid Zeuthen <davidz@redhat.com>2009-06-17 17:41:47 -0400
commit97abc2c5cf4f4774ef67f38976a2d4c681bcccdf (patch)
treee8fecb046ea56d851463d5ae8b27b68eddeab9a3
parent0dd09e9ff5998d4bfd7707be8524b265eb0313a5 (diff)
Change the location of the config files to /etc/xdg/hostname-1
Instead of its own directory under /etc
-rw-r--r--docs/xdg-hostname-docs.xml6
-rw-r--r--src/daemon/xdg-hostname-daemon.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/docs/xdg-hostname-docs.xml b/docs/xdg-hostname-docs.xml
index af057c2..c9170bf 100644
--- a/docs/xdg-hostname-docs.xml
+++ b/docs/xdg-hostname-docs.xml
@@ -384,7 +384,7 @@ xdg-hostname-1 --set-hostname `/bin/hostname`
Depending on the operating system, other actions,
such as updating one or more configuration files, may need to
happen. To accommodate this, all executable programs in the
- <literal>/etc/xdg-hostname-1/run.d</literal>
+ <literal>/etc/xdg/hostname-1/run.d</literal>
directory with the extension <literal>.run</literal>
will be invoked (sequentially, in the C locale's alphabetical order)
by
@@ -408,7 +408,7 @@ xdg-hostname-1 --set-hostname `/bin/hostname`
A number of applications require that the name returned by
<literal>gethostname(2)</literal> resolves to the local
machine (typically 127.0.0.1). This can be achieved via
- either using a <literal>.run</literal> script in <literal>/etc/xdg-hostname-1/run.d</literal> that updates
+ either using a <literal>.run</literal> script in <literal>/etc/xdg/hostname-1/run.d</literal> that updates
the <literal>/etc/hosts</literal> file
or through a
<ulink url="http://en.wikipedia.org/wiki/GNU_C_Library">GNU C Library</ulink>
@@ -423,7 +423,7 @@ xdg-hostname-1 --set-hostname `/bin/hostname`
will always attempt write the current hostname (e.g. the value
of the
<link linkend="Hostname1:hostname">hostname</link>
- property) to the <literal>/etc/xdg-hostname-1/hostname</literal>
+ property) to the <literal>/etc/xdg/hostname-1/hostname</literal>
file (specifically this file may be a symlink to e.g. the
<literal>/etc/hostname</literal> file).
Operating system boot scripts may use the contents of this
diff --git a/src/daemon/xdg-hostname-daemon.c b/src/daemon/xdg-hostname-daemon.c
index 76d0a1e..5e13ba4 100644
--- a/src/daemon/xdg-hostname-daemon.c
+++ b/src/daemon/xdg-hostname-daemon.c
@@ -242,7 +242,7 @@ xdg_hostname_daemon_get_property (GObject *object,
case PROP_HOSTNAME:
/* The hostname may have several labels before we can get it
- * from the kernel or from the /etc/xdg-hostname-1/hostname
+ * from the kernel or from the /etc/xdg/hostname-1/hostname
* file that the user may manually edit.
*
* However, only return the first label to the user, anything
@@ -659,7 +659,7 @@ update_data (XdgHostnameDaemon *daemon,
g_strstrip (kernel_name);
- if (g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/hostname",
+ if (g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/hostname",
&buf,
&size,
&local_error)) {
@@ -670,14 +670,14 @@ update_data (XdgHostnameDaemon *daemon,
/* TODO: use syslog instead */
g_warning ("gethostname(2) returned hostname '%s' and our configuration file "
"has hostname '%s'. "
- "Updating /etc/xdg-hostname-1/hostname to use name from gethostname(2).",
+ "Updating /etc/xdg/hostname-1/hostname to use name from gethostname(2).",
kernel_name,
buf);
g_free (buf);
buf = NULL;
- if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/hostname",
+ if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/hostname",
kernel_name,
strlen (kernel_name),
error)) {
@@ -702,7 +702,7 @@ update_data (XdgHostnameDaemon *daemon,
}
}
- if (g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/data",
+ if (g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/data",
&buf,
&size,
&local_error)) {
@@ -830,7 +830,7 @@ _xdg_hostname_priv_set_data (SetDataFlags flags,
/* TODO: sanity check data */
if (flags & SET_HOSTNAME) {
- if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/hostname",
+ if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/hostname",
hostname,
strlen (hostname),
error)) {
@@ -853,7 +853,7 @@ _xdg_hostname_priv_set_data (SetDataFlags flags,
GKeyFile *key_file;
key_file = g_key_file_new ();
- if (!g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/data",
+ if (!g_file_get_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/data",
&buf,
&size,
&local_error)) {
@@ -910,7 +910,7 @@ _xdg_hostname_priv_set_data (SetDataFlags flags,
goto out;
}
- if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg-hostname-1/data",
+ if (!g_file_set_contents (PACKAGE_SYSCONF_DIR "/xdg/hostname-1/data",
buf,
strlen (buf),
error)) {