SHA256
1
0
forked from pool/systemd

Accepting request 173532 from home:fcrozat:branches:Base:System

- Fix handle-etc-HOSTNAME.patch to properly set hostname at startup
  when using /etc/HOSTNAME.

OBS-URL: https://build.opensuse.org/request/show/173532
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=372
This commit is contained in:
Dr. Werner Fink 2013-04-26 16:25:08 +00:00 committed by Git OBS Bridge
parent 99692aaa9b
commit 4bc38fd973
3 changed files with 49 additions and 2 deletions

View File

@ -4,8 +4,43 @@ 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

View File

@ -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

View File

@ -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