Skip to content

Commit

Permalink
Merge pull request #334 from tuxmea/fix_systemd
Browse files Browse the repository at this point in the history
Fix systemd templates
  • Loading branch information
bastelfreak authored Aug 27, 2024
2 parents 35ba308 + 3d6e74e commit 8be98d1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion functions/service_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function wildfly::service_config(
'conf_file' => '/etc/default/jboss-eap.conf',
'conf_template' => 'wildfly/wildfly.sysvinit.conf',
'service_file' => 'bin/init.d/jboss-eap-rhel.sh',
'systemd_template' => 'jboss-eap/jboss-eap.systemd.service',
'systemd_template' => 'wildfly/jboss-eap.systemd.service',
}
}
default: {
Expand Down
2 changes: 1 addition & 1 deletion manifests/service/systemd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
owner => $wildfly::user,
group => $wildfly::group,
# need to manage this until it's fixed in the upstream
content => file('wildfly/launch.sh'),
content => epp('wildfly/launch.sh.epp'),
before => File["/etc/systemd/system/${wildfly::service::service_name}.service"],
}

Expand Down
2 changes: 1 addition & 1 deletion spec/functions/service_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
let(:version) { '7.0' }

it 'using systemd' do
is_expected.to run.with_params(distribution, version, 'standalone').and_return('service_file' => 'bin/init.d/jboss-eap-rhel.sh', 'conf_file' => '/etc/default/jboss-eap.conf', 'service_name' => 'jboss-eap', 'conf_template' => 'wildfly/wildfly.sysvinit.conf', 'systemd_template' => 'jboss-eap/jboss-eap.systemd.service')
is_expected.to run.with_params(distribution, version, 'standalone').and_return('service_file' => 'bin/init.d/jboss-eap-rhel.sh', 'conf_file' => '/etc/default/jboss-eap.conf', 'service_name' => 'jboss-eap', 'conf_template' => 'wildfly/wildfly.sysvinit.conf', 'systemd_template' => 'wildfly/jboss-eap.systemd.service')
end
end
end
2 changes: 1 addition & 1 deletion templates/jboss-eap.systemd.service.epp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ User=<%= $wildfly::user %>
Group=<%= $wildfly::group %>
EnvironmentFile=/etc/default/jboss-eap.conf
LimitNOFILE=102642
ExecStart=<%= $wildfly::dirname %>/bin/standalone.sh ${WILDFLY_MODE} ${WILDFLY_CONFIG}
ExecStart=<%= $wildfly::dirname %>/bin/launch.sh ${WILDFLY_MODE} ${WILDFLY_CONFIG}
Restart=always
RestartSec=20
StandardOutput=null
Expand Down
15 changes: 15 additions & 0 deletions templates/launch.sh.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# THIS FILE IS MANAGED BY PUPPET

if [ "x$WILDFLY_HOME" = "x" ]; then
WILDFLY_HOME="<%= $wildfly::dirname %>"
fi

mode="$1"
shift

if [[ "$mode" == "domain" ]]; then
exec $WILDFLY_HOME/bin/domain.sh -c "$@"
else
exec $WILDFLY_HOME/bin/standalone.sh -c "$@"
fi

0 comments on commit 8be98d1

Please sign in to comment.