Skip to content

Commit 99263e1

Browse files
committed
Restore foreground.erb
foreground is a subcommand for openvox-server and openvoxdb. This this a public interface to our users and removing it is a breaking change. This fixes a regression introduced in b2de7c7
1 parent 81e4c9b commit 99263e1

File tree

1 file changed

+48
-0
lines changed
  • resources/puppetlabs/lein-ezbake/template/global/ext/cli

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
restartfile="/opt/puppetlabs/server/data/<%= EZBake::Config[:real_name] %>/restartcounter"
4+
cli_defaults=${INSTALL_DIR}/cli/cli-defaults.sh
5+
6+
if [ ! -e "${INSTALL_DIR}/ezbake-functions.sh" ]; then
7+
echo "Unable to find ${INSTALL_DIR}/ezbake-functions.sh script, failing start." 1>&2
8+
exit 1
9+
fi
10+
11+
. "${INSTALL_DIR}/ezbake-functions.sh"
12+
13+
init_restart_file "$restartfile" || exit $?
14+
15+
if !(echo "${@}" | grep -e "--debug" -q)
16+
then
17+
LOG_APPENDER="-Dlogappender=STDOUT"
18+
fi
19+
20+
CLASSPATH="${INSTALL_DIR}/<%= EZBake::Config[:uberjar_name] %>"
21+
22+
if [ -e "$cli_defaults" ]; then
23+
. $cli_defaults
24+
if [ $? -ne 0 ]; then
25+
echo "Unable to initialize cli defaults, failing start." 1>&2
26+
exit 1
27+
fi
28+
fi
29+
30+
COMMAND="${JAVA_BIN} ${JAVA_ARGS} ${LOG_APPENDER} \
31+
-cp "$CLASSPATH" \
32+
clojure.main -m <%= EZBake::Config[:main_namespace] %> \
33+
--config ${CONFIG} --bootstrap-config ${BOOTSTRAP_CONFIG} \
34+
--restart-file "${restartfile}" \
35+
${TK_ARGS} \
36+
${@}"
37+
38+
pushd "${INSTALL_DIR}" &> /dev/null
39+
if [ "$EUID" = "0" ] && command -v runuser &> /dev/null; then
40+
runuser "${USER}" -s /bin/bash -c "$COMMAND"
41+
elif [ "$EUID" = "$(id -u ${USER})" ]; then
42+
/bin/bash -c "$COMMAND"
43+
elif command -v sudo &> /dev/null; then
44+
sudo -H -u "${USER}" $COMMAND
45+
else
46+
su "${USER}" -s /bin/bash -c "$COMMAND"
47+
fi
48+
popd &> /dev/null

0 commit comments

Comments
 (0)