Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ templates:
- ext/debian/postinst.erb
- ext/config/user/conf.d/*.erb
- ext/bin/*.erb
- ext/cli/apps/*.erb
- ext/cli/*.erb
- ext/cli_defaults/*.erb
- ext/default.erb
- ext/ezbake-functions.sh.erb
- install.sh.erb
- controller.sh.erb
tar_excludes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Init settings for <%= EZBake::Config[:project] %>
###########################################

# Location of your Java binary
# used by openvox-server CLI apps, not by the systemd unit
JAVA_BIN="<%= EZBake::Config[:java_bin] %>"

# Modify this if you'd like to change the memory allocation, enable JMX, etc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
#!/usr/bin/env bash

restartfile="/opt/puppetlabs/server/data/<%= EZBake::Config[:real_name] %>/restartcounter"
cli_defaults=${INSTALL_DIR}/cli/cli-defaults.sh

if [ ! -e "${INSTALL_DIR}/ezbake-functions.sh" ]; then
echo "Unable to find ${INSTALL_DIR}/ezbake-functions.sh script, failing start." 1>&2
exit 1
if [ ! -e "$restartfile" ]; then
printf '0' | /usr/bin/install -D -o "${USER:-<%= EZBake::Config[:user] %>}" -g "${GROUP:-<%= EZBake::Config[:group] %>}" -m 0644 /dev/stdin "$restartfile"
fi

. "${INSTALL_DIR}/ezbake-functions.sh"

init_restart_file "$restartfile" || exit $?

if !(echo "${@}" | grep -e "--debug" -q)
if ! (echo "${@}" | grep -e "--debug" -q)
then
LOG_APPENDER="-Dlogappender=STDOUT"
fi

CLASSPATH="${INSTALL_DIR}/<%= EZBake::Config[:uberjar_name] %>"

cli_defaults="${INSTALL_DIR}/cli/cli-defaults.sh"
if [ -e "$cli_defaults" ]; then
. $cli_defaults
. "$cli_defaults"
if [ $? -ne 0 ]; then
echo "Unable to initialize cli defaults, failing start." 1>&2
exit 1
fi
fi

COMMAND="${JAVA_BIN} ${JAVA_ARGS} ${LOG_APPENDER} \
-cp "$CLASSPATH" \
-cp '${CLASSPATH}' \
clojure.main -m <%= EZBake::Config[:main_namespace] %> \
--config ${CONFIG} --bootstrap-config ${BOOTSTRAP_CONFIG} \
--restart-file "${restartfile}" \
--restart-file '${restartfile}' \
${TK_ARGS} \
${@}"

Expand Down

This file was deleted.

120 changes: 0 additions & 120 deletions resources/puppetlabs/lein-ezbake/template/global/ext/cli/start.erb

This file was deleted.

26 changes: 0 additions & 26 deletions resources/puppetlabs/lein-ezbake/template/global/ext/cli/stop.erb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ Wants=<%= EZBake::Config[:start_after].map {|dep| "#{dep}.service" }.join(" ") %
<% end -%>

[Service]
Type=forking
Type=notify-reload
LogsDirectory=puppetlabs/<%= EZBake::Config[:real_name] %>
RuntimeDirectory=puppetlabs/<%= EZBake::Config[:real_name] %>
EnvironmentFile=/etc/default/<%= EZBake::Config[:project] %>
User=<%= EZBake::Config[:user] %>
TimeoutStartSec=<%= EZBake::Config[:start_timeout] %>
TimeoutStopSec=<%= EZBake::Config[:stop_timeout] %>
Restart=on-failure
StartLimitBurst=5
PIDFile=/run/puppetlabs/<%= EZBake::Config[:real_name] %>/<%= EZBake::Config[:real_name] %>.pid
PrivateTmp=true

# https://tickets.puppetlabs.com/browse/EZ-129
Expand All @@ -50,15 +51,22 @@ ExecStartPre=<%= action %>
<% end -%>
<% end -%>

ExecReload=/opt/puppetlabs/server/apps/<%= EZBake::Config[:real_name] %>/bin/<%= EZBake::Config[:real_name] %> reload
ExecStart=/opt/puppetlabs/server/apps/<%= EZBake::Config[:real_name] %>/bin/<%= EZBake::Config[:real_name] %> start
ExecStop=/opt/puppetlabs/server/apps/<%= EZBake::Config[:real_name] %>/bin/<%= EZBake::Config[:real_name] %> stop
ExecStart=<%= EZBake::Config[:java_bin] %> $JAVA_ARGS -Dlogappender=F1 \
'-XX:OnOutOfMemoryError=kill -9 %p' -XX:+CrashOnOutOfMemoryError \
-XX:ErrorFile="${LOGS_DIRECTORY}/<%= EZBake::Config[:real_name] %>_err_pid%p.log" \
-cp "${INSTALL_DIR}/<%= EZBake::Config[:uberjar_name] %>" \
clojure.main \
-m <%= EZBake::Config[:main_namespace] %> \
--config "${CONFIG}" \
--bootstrap-config "${BOOTSTRAP_CONFIG}" \
$TK_ARGS

KillMode=process

<% EZBake::Config[:debian][:post_start_action].each do |action| -%>
ExecStartPost=-<%= action %>
<% end -%>
ExecReload=kill -HUP $MAINPID
SuccessExitStatus=143

[Install]
Expand Down
Loading