Hack to support service on xenial

Xenial uses systemd which does have a sysv init script compatbility
layer but you must instruct systemd to reload its config after
installing any init scripts for this to work. Hack this in by adding an
exec for `systemctl daemon-reload` between writing the file and starting
the wildlfy service. Ideally the wildfly module would do this for us but
this should work for now (and eventually will become redundant).

Change-Id: If5c09c0be7714ce7d03ebf364823164a34c29ae4
This commit is contained in:
Clark Boylan 2016-11-23 09:47:20 -08:00
parent 3d264a2e2b
commit c5bddd9e19
1 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,17 @@ class zanata::wildfly(
ensure => present,
}
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 { 'wildfly-systemd-daemon-reload':
command => '/usr/bin/systemctl daemon-reload',
before => Service['wildfly'],
subscribe => File['/etc/init.d/wildfly'],
refreshonly => true,
}
}
class { '::wildfly':
version => $wildfly_version,
install_source => $wildfly_install_source,