Run daemon-reload after installing log processor init script

Now that we are upgrading to Xenial, we need to take into account
that we're running with systemd and reload it so that it picks up the
new service.

Change-Id: Id02ac2bc51132a8d8d4a77cb05d41fa902765b28
This commit is contained in:
David Moreau Simard 2017-12-11 09:45:02 -05:00
parent 54eb1a0785
commit b87b76f27c
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
1 changed files with 11 additions and 0 deletions

View File

@ -41,6 +41,17 @@ define log_processor::worker (
],
}
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 { "jenkins-log-worker${suffix}-systemd-daemon-reload":
command => '/bin/systemctl daemon-reload',
before => Service["jenkins-log-worker${suffix}"],
subscribe => File["/etc/init.d/jenkins-log-worker${suffix}"],
refreshonly => true,
}
}
service { "jenkins-log-worker${suffix}":
enable => true,
hasrestart => true,