From aaa485a777aa8e72fad8a5eecd85a9a2f18c72ec Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 18 Jan 2018 09:05:39 -0500 Subject: [PATCH] Support systemdctl daemon-reload for nodepool services Otherwise, when we modify systemd unit files, we won't be able the use them. Change-Id: Ie2a383e771a4f6fe606614ed09134576ca5b6a66 Signed-off-by: Paul Belanger --- manifests/builder.pp | 11 +++++++++++ manifests/launcher.pp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/manifests/builder.pp b/manifests/builder.pp index 47a403c..1a36122 100644 --- a/manifests/builder.pp +++ b/manifests/builder.pp @@ -72,6 +72,17 @@ class nodepool::builder( content => template($builder_logging_conf_template), } + if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease >= '16.04') { + # This is a hack to make sure that systemd is aware of the new service + # before we attempt to start it. + exec { 'nodepool-builder-systemd-daemon-reload': + command => '/bin/systemctl daemon-reload', + before => Service['nodepool-builder'], + subscribe => File['/etc/init.d/nodepool-builder'], + refreshonly => true, + } + } + service { 'nodepool-builder': name => 'nodepool-builder', enable => true, diff --git a/manifests/launcher.pp b/manifests/launcher.pp index e41caac..00036be 100644 --- a/manifests/launcher.pp +++ b/manifests/launcher.pp @@ -66,6 +66,17 @@ class nodepool::launcher( content => template($launcher_logging_conf_template), } + if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease >= '16.04') { + # This is a hack to make sure that systemd is aware of the new service + # before we attempt to start it. + exec { 'nodepool-launcher-systemd-daemon-reload': + command => '/bin/systemctl daemon-reload', + before => Service['nodepool-launcher'], + subscribe => File['/etc/init.d/nodepool-launcher'], + refreshonly => true, + } + } + service { 'nodepool-launcher': name => 'nodepool-launcher', enable => true,