Skip to content

Commit

Permalink
[fix #472] /etc/default/<package-name> should be shell script setting…
Browse files Browse the repository at this point in the history
… envars
  • Loading branch information
dhardy92 committed Jan 27, 2015
1 parent 1582800 commit 520ffaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,6 @@ run() {
exit $exit_code
}

# Loads a configuration file full of default command line options for this script.
loadConfigFile() {
cat "$1" | sed '/^\#/d'
}

# Now check to see if it's a good enough version
# TODO - Check to see if we have a configured default java version, otherwise use 1.6
java_version_check() {
Expand Down Expand Up @@ -367,7 +362,9 @@ ${{template_declares}}
# java_cmd is overrode in process_args when -java-home is used
declare java_cmd=$(get_java_cmd)

# if configuration files exist, prepend their contents to $@ so it can be processed by this runner
[[ -f "$script_conf_file" ]] && set -- $(loadConfigFile "$script_conf_file") "$@"

# if configuration files exist, source it and use JAVA_OPTS to prepend their contents to $@
[[ -f "$script_conf_file" ]] && . "$script_conf_file"
set -- "$JAVA_OPTS" "$@"

run "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ${{daemon_user}} daemon user
# -------------------------------------------------

# Using $JAVA_OPTS envars
# Setting -Xmx and -Xms in Megabyte
# -mem 1024

Expand All @@ -31,4 +32,8 @@
# -jvm-debug <port>

# Don't run the java version check
# -no-version-check
# -no-version-check

# Example
# JAVA_OPTS=" -Dpidfile.path=/var/run/${{app_name}}/play.pid $JAVA_OPTS"
# JAVA_OPTS=" -mem 1024 -Dkey=val -jvm-debug $JAVA_OPTS"

0 comments on commit 520ffaf

Please sign in to comment.