Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

(PDB-468)(packaging) Fixup systemd service configuration #867

Merged
merged 1 commit into from Feb 21, 2014

Conversation

Projects
None yet
4 participants
Contributor

shrug commented Feb 21, 2014

Systemd will not allow variable substitution in a number of places in the service definition file. Most importantly, the first argument to the ExecStart command and the User and PIDFile parameters.

In addition, as the file referenced in EnvironmentFile is not interpreted by a shell, but read in directly by systemd, it can not have logic, but must be composed solely of variable assignments.

This PR updates the service definition file to use a hardcoded reference to the java-1.7.0-openjdk install (checked on F19, F20 and the RHEL 7 beta). Also updates the /etc/sysconfig/puppetdb file on those platforms to conform to the format supported by systemd.

@shrug shrug (PDB-468)(packaging) Fixup systemd service configuration
Systemd will not allow variable substitution in a number of places in the service definition file. Most importantly, the first argument to the ExecStart command and the User and PIDFile parameters.

In addition, as the file referenced in EnvironmentFile is not interpreted by a shell, but read in directly by systemd, it can not have logic, but must be composed solely of variable assignments.

This PR updates the service definition file to use a hardcoded reference to the java-1.7.0-openjdk install (checked on F19, F20 and the RHEL 7 beta). Also updates the /etc/sysconfig/puppetdb file on those platforms to conform to the format supported by systemd.
fee7927

Can one of the admins verify this patch?

Contributor

senior commented Feb 21, 2014

test this please

Contributor

senior commented Feb 21, 2014

retest this please

Contributor

senior commented Feb 21, 2014

ubuntu mirror issue ^

Contributor

senior commented Feb 21, 2014

retest this please

CLA signed by all contributors.

@senior senior added a commit that referenced this pull request Feb 21, 2014

@senior senior Merge pull request #867 from shrug/1.6.x
(PDB-468)(packaging) Fixup systemd service configuration
f60a235

@senior senior merged commit f60a235 into puppetlabs:1.6.x Feb 21, 2014

1 check passed

default The Travis CI build passed
Details

@senior senior commented on the diff Feb 21, 2014

ext/templates/puppetdb.service.erb
-jar ${INSTALL_DIR}/puppetdb.jar \
- services -c ${CONFG} $@
+ services -c ${CONFIG} $@
+<%- else -%>
+ExecStart=/usr/lib/jvm/jre-1.7.0-openjdk/bin/java \
@senior

senior Feb 21, 2014

Contributor

@shrug I missed this yesterday, shouldn't this be JAVA_BIN?

@shrug

shrug Feb 21, 2014

Contributor

I wish, but no it can't be. Systemd disallows variables as the first argument to ExecStart, so it can't be set via an outside configuration file. This is currently set to a good path on F19-20 and EL7 (which are the only platforms where this file gets packaged currently). We will probably need to rethink the templating strategy when we need to support another systemd platform with a different scheme for pathing the java binaries.

@senior senior commented on the diff Feb 21, 2014

ext/templates/puppetdb_default_systemd.erb
@@ -0,0 +1,17 @@
+###########################################
+# Init settings for <%= @name %>
+###########################################
+
+# Location of your Java binary
+<%- if @pe -%>
+JAVA_BIN="<%= @java_bin %>"
+<%- else -%>
+JAVA_BIN="/usr/lib/jvm/jre-1.7.0-openjdk/bin/java"
@senior

senior Feb 21, 2014

Contributor

@shrug here too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment