From 497653472a5d517c1dc0350b5f681724aba5b958 Mon Sep 17 00:00:00 2001 From: Dan Kelleher Date: Thu, 20 Aug 2015 09:43:51 -0400 Subject: [PATCH] Add link between one-context.service and systemd-networkd.service also updated 00-network and 05-hostname One-context.service should be linked to systemd-networkd.service, tying to do this using the Wants flag. Additionally since one-context.service should now run before systemd-networkd.service it's superfluous to restart the unit, this was edited out of 00-network. 05-hostname was edited to use the hostnameclt, the echo style can probably be removed. --- base_arch/etc/one-context.d/00-network | 11 +---------- base_arch/etc/one-context.d/05-hostname | 2 +- base_arch/usr/lib/systemd/system/one-context.service | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/base_arch/etc/one-context.d/00-network b/base_arch/etc/one-context.d/00-network index e34693b..95ae091 100755 --- a/base_arch/etc/one-context.d/00-network +++ b/base_arch/etc/one-context.d/00-network @@ -226,14 +226,5 @@ EOT done } -configure_network() -{ - gen_network_configuration - - systemctl restart systemd-networkd - - sleep 2 -} - -configure_network +gen_network_configuration diff --git a/base_arch/etc/one-context.d/05-hostname b/base_arch/etc/one-context.d/05-hostname index c5f9e1d..67130f8 100755 --- a/base_arch/etc/one-context.d/05-hostname +++ b/base_arch/etc/one-context.d/05-hostname @@ -9,7 +9,7 @@ function set_hostname() { echo $NAME > $CONFIG_FILE - hostname $NAME + hostnamectl set-hostname $NAME } function get_dns_name() { diff --git a/base_arch/usr/lib/systemd/system/one-context.service b/base_arch/usr/lib/systemd/system/one-context.service index 2ee7905..d4f6ccc 100644 --- a/base_arch/usr/lib/systemd/system/one-context.service +++ b/base_arch/usr/lib/systemd/system/one-context.service @@ -4,11 +4,11 @@ Description=Context script for open nebula # dropped once tuntap is moved to netlink After=systemd-udevd.service dbus.service network-pre.target systemd-sysusers.service systemd-sysctl.service Before=systemd-networkd.service -Wants=network.target +Wants=network.target systemd-networkd.service # On kdbus systems we pull in the busname explicitly, because it # carries policy that allows the daemon to acquire its name. -Wants=org.freedesktop.network1.busname +Wants=org.freedesktop.network1.busname systemd-networkd.service After=org.freedesktop.network1.busname [Service]