diff --git a/handle-etc-HOSTNAME.patch b/handle-etc-HOSTNAME.patch index 2688e851..a547f9f3 100644 --- a/handle-etc-HOSTNAME.patch +++ b/handle-etc-HOSTNAME.patch @@ -4,9 +4,44 @@ Subject: handle /etc/HOSTNAME (bnc#803653) --- - src/hostname/hostnamed.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) + src/core/hostname-setup.c | 22 +++++++++++++++++----- + src/hostname/hostnamed.c | 12 +++++++++++- + 2 files changed, 28 insertions(+), 6 deletions(-) +diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c +index ac508af..15d206c 100644 +--- a/src/core/hostname-setup.c ++++ b/src/core/hostname-setup.c +@@ -61,12 +61,24 @@ int hostname_setup(void) { + + r = read_and_strip_hostname("/etc/hostname", &b); + if (r < 0) { +- if (r == -ENOENT) +- enoent = true; +- else ++ if (r == -ENOENT) { ++ /* use SUSE fallback */ ++ r = read_and_strip_hostname("/etc/HOSTNAME", &b); ++ if (r < 0) { ++ if (r == -ENOENT) ++ enoent = true; ++ else ++ log_warning("Failed to read configured hostname: %s", strerror(-r)); ++ hn = NULL; ++ } ++ else ++ hn = b; ++ ++ } ++ else { + log_warning("Failed to read configured hostname: %s", strerror(-r)); +- +- hn = NULL; ++ hn = NULL; ++ } + } else + hn = b; + diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index c7f454c..cfbd706 100644 --- a/src/hostname/hostnamed.c diff --git a/systemd-mini.changes b/systemd-mini.changes index 6a125ce6..6cc8c273 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 26 16:37:28 CEST 2013 - fcrozat@suse.com + +- Fix handle-etc-HOSTNAME.patch to properly set hostname at startup + when using /etc/HOSTNAME. + ------------------------------------------------------------------- Thu Apr 25 08:19:30 UTC 2013 - rmilasan@suse.com diff --git a/systemd.changes b/systemd.changes index 6a125ce6..6cc8c273 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 26 16:37:28 CEST 2013 - fcrozat@suse.com + +- Fix handle-etc-HOSTNAME.patch to properly set hostname at startup + when using /etc/HOSTNAME. + ------------------------------------------------------------------- Thu Apr 25 08:19:30 UTC 2013 - rmilasan@suse.com