SHA256
1
0
forked from pool/systemd
systemd/ensure-shortname-is-set-as-hostname-bnc-820213.patch

32 lines
1.0 KiB
Diff
Raw Normal View History

Accepting request 176957 from home:fcrozat:branches:Base:System - Update to release 204: + systemd-nspawn creates etc/resolv.conf in container if needed. + systemd-nspawn will store metadata about container in container cgroup including its root directory. + cgroup hierarchy has been reworked, all objects are now suffxed (with .session for user sessions, .user for users, .nspawn for containers). All cgroup names are now escaped to preven collision of object names. + systemctl list-dependencies gained --plain, --reverse, --after and --before switches. + systemd-inhibit shows processes name taking inhibitor lock. + nss-myhostname will now resolve "localhost" implicitly. + .include is not allowed recursively anymore and only in unit files. Drop-in files should be favored in most cases. + systemd-analyze gained "critical-chain" command, to get slowest chain of units run during boot-up. + systemd-nspawn@.service has been added to easily run nspawn container for system services. Just start "systemd-nspawn@foobar.service" and container from /var/lib/container/foobar" will be booted. + systemd-cgls has new --machine parameter to list processes from one container. + ConditionSecurity= can now check for apparmor and SMACK. + /etc/systemd/sleep.conf has been introduced to configure which kernel operation will be execute when "suspend", "hibernate" or "hybrid-sleep" is requrested. It allow new kernel "freeze" state to be used too. (This setting won't have any effect if pm-utils is installed). + ENV{SYSTEMD_WANTS} in udev rules will now implicitly escape passed argument if applicable. OBS-URL: https://build.opensuse.org/request/show/176957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=388
2013-05-29 17:26:40 +02:00
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 28 May 2013 15:17:35 +0200
Subject: ensure shortname is set as hostname (bnc#820213)
strip hostname so the domain part isn't set as part of the hostname
---
src/core/hostname-setup.c | 4 ++++
1 file changed, 4 insertions(+)
Accepting request 176957 from home:fcrozat:branches:Base:System - Update to release 204: + systemd-nspawn creates etc/resolv.conf in container if needed. + systemd-nspawn will store metadata about container in container cgroup including its root directory. + cgroup hierarchy has been reworked, all objects are now suffxed (with .session for user sessions, .user for users, .nspawn for containers). All cgroup names are now escaped to preven collision of object names. + systemctl list-dependencies gained --plain, --reverse, --after and --before switches. + systemd-inhibit shows processes name taking inhibitor lock. + nss-myhostname will now resolve "localhost" implicitly. + .include is not allowed recursively anymore and only in unit files. Drop-in files should be favored in most cases. + systemd-analyze gained "critical-chain" command, to get slowest chain of units run during boot-up. + systemd-nspawn@.service has been added to easily run nspawn container for system services. Just start "systemd-nspawn@foobar.service" and container from /var/lib/container/foobar" will be booted. + systemd-cgls has new --machine parameter to list processes from one container. + ConditionSecurity= can now check for apparmor and SMACK. + /etc/systemd/sleep.conf has been introduced to configure which kernel operation will be execute when "suspend", "hibernate" or "hybrid-sleep" is requrested. It allow new kernel "freeze" state to be used too. (This setting won't have any effect if pm-utils is installed). + ENV{SYSTEMD_WANTS} in udev rules will now implicitly escape passed argument if applicable. OBS-URL: https://build.opensuse.org/request/show/176957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=388
2013-05-29 17:26:40 +02:00
Index: systemd-221/src/core/hostname-setup.c
===================================================================
--- systemd-221.orig/src/core/hostname-setup.c
+++ systemd-221/src/core/hostname-setup.c
@@ -34,6 +34,7 @@ int hostname_setup(void) {
Accepting request 176957 from home:fcrozat:branches:Base:System - Update to release 204: + systemd-nspawn creates etc/resolv.conf in container if needed. + systemd-nspawn will store metadata about container in container cgroup including its root directory. + cgroup hierarchy has been reworked, all objects are now suffxed (with .session for user sessions, .user for users, .nspawn for containers). All cgroup names are now escaped to preven collision of object names. + systemctl list-dependencies gained --plain, --reverse, --after and --before switches. + systemd-inhibit shows processes name taking inhibitor lock. + nss-myhostname will now resolve "localhost" implicitly. + .include is not allowed recursively anymore and only in unit files. Drop-in files should be favored in most cases. + systemd-analyze gained "critical-chain" command, to get slowest chain of units run during boot-up. + systemd-nspawn@.service has been added to easily run nspawn container for system services. Just start "systemd-nspawn@foobar.service" and container from /var/lib/container/foobar" will be booted. + systemd-cgls has new --machine parameter to list processes from one container. + ConditionSecurity= can now check for apparmor and SMACK. + /etc/systemd/sleep.conf has been introduced to configure which kernel operation will be execute when "suspend", "hibernate" or "hybrid-sleep" is requrested. It allow new kernel "freeze" state to be used too. (This setting won't have any effect if pm-utils is installed). + ENV{SYSTEMD_WANTS} in udev rules will now implicitly escape passed argument if applicable. OBS-URL: https://build.opensuse.org/request/show/176957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=388
2013-05-29 17:26:40 +02:00
int r;
_cleanup_free_ char *b = NULL;
const char *hn;
+ char *domain;
bool enoent = false;
Accepting request 176957 from home:fcrozat:branches:Base:System - Update to release 204: + systemd-nspawn creates etc/resolv.conf in container if needed. + systemd-nspawn will store metadata about container in container cgroup including its root directory. + cgroup hierarchy has been reworked, all objects are now suffxed (with .session for user sessions, .user for users, .nspawn for containers). All cgroup names are now escaped to preven collision of object names. + systemctl list-dependencies gained --plain, --reverse, --after and --before switches. + systemd-inhibit shows processes name taking inhibitor lock. + nss-myhostname will now resolve "localhost" implicitly. + .include is not allowed recursively anymore and only in unit files. Drop-in files should be favored in most cases. + systemd-analyze gained "critical-chain" command, to get slowest chain of units run during boot-up. + systemd-nspawn@.service has been added to easily run nspawn container for system services. Just start "systemd-nspawn@foobar.service" and container from /var/lib/container/foobar" will be booted. + systemd-cgls has new --machine parameter to list processes from one container. + ConditionSecurity= can now check for apparmor and SMACK. + /etc/systemd/sleep.conf has been introduced to configure which kernel operation will be execute when "suspend", "hibernate" or "hybrid-sleep" is requrested. It allow new kernel "freeze" state to be used too. (This setting won't have any effect if pm-utils is installed). + ENV{SYSTEMD_WANTS} in udev rules will now implicitly escape passed argument if applicable. OBS-URL: https://build.opensuse.org/request/show/176957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=388
2013-05-29 17:26:40 +02:00
r = read_hostname_config("/etc/hostname", &b);
@@ -46,6 +47,9 @@ int hostname_setup(void) {
hn = NULL;
} else
hn = b;
Accepting request 176957 from home:fcrozat:branches:Base:System - Update to release 204: + systemd-nspawn creates etc/resolv.conf in container if needed. + systemd-nspawn will store metadata about container in container cgroup including its root directory. + cgroup hierarchy has been reworked, all objects are now suffxed (with .session for user sessions, .user for users, .nspawn for containers). All cgroup names are now escaped to preven collision of object names. + systemctl list-dependencies gained --plain, --reverse, --after and --before switches. + systemd-inhibit shows processes name taking inhibitor lock. + nss-myhostname will now resolve "localhost" implicitly. + .include is not allowed recursively anymore and only in unit files. Drop-in files should be favored in most cases. + systemd-analyze gained "critical-chain" command, to get slowest chain of units run during boot-up. + systemd-nspawn@.service has been added to easily run nspawn container for system services. Just start "systemd-nspawn@foobar.service" and container from /var/lib/container/foobar" will be booted. + systemd-cgls has new --machine parameter to list processes from one container. + ConditionSecurity= can now check for apparmor and SMACK. + /etc/systemd/sleep.conf has been introduced to configure which kernel operation will be execute when "suspend", "hibernate" or "hybrid-sleep" is requrested. It allow new kernel "freeze" state to be used too. (This setting won't have any effect if pm-utils is installed). + ENV{SYSTEMD_WANTS} in udev rules will now implicitly escape passed argument if applicable. OBS-URL: https://build.opensuse.org/request/show/176957 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=388
2013-05-29 17:26:40 +02:00
+ /* strip any leftover of a domain name */
+ if ((domain = strchr(hn, '.')) != NULL)
+ *domain = '\0';
if (isempty(hn)) {
/* Don't override the hostname if it is already set