-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify JAVA_OPTS for JavaServer archetype? #98
Comments
IIRC, the script should look for arguments in the /etc// See:
I think it's not actually exposed well, so for now the workaround to a nicer model is to do something like:
Then, you should be able to place a default config file in
I'll try to get this exposed in a nicer fashion for the server archetype soon (Note: The archetype is still "experimental", but I'm happy so many people are helping refine it so quickly). |
Great! Thanks for the detailed response, especially with a code sample. I'll give this a try and report back. Cheers! Blake |
I would like to add an example to this ticket.
|
#121 almost fixes this issue for SystemV and with a minor change for Upstart as well. To add Java_Opts settings you just have to create After #121 is merged I will change the method as describe by @jsuereth and add a setting This can be overridden with
Note that this configuration is just for bootstrapping the application. Not for runtime. |
@muuki88 thanks for the feedback. the etc-default will not work for setting passwords (since they should not be included in the repository) and as you mentioned the bashConfigFileLocation is not helping, either for the upstart problem. any other suggestion how to pass env vars to the upstart script with the current code? |
@magegu I add an empty bash config file to my packages and then use a configuration tool (Puppet or Augeas in my case) to insert production configuration/parameters into the file on disk after the package has been installed. The Debian package knows the bash config file is used for configuration and won't overwrite your changes in the future when the package is upgraded |
I like @aparkinson approach. As @jsuereth mentioned in #121
then we can use this for upstart, too. |
@kardapoltsev had a good idea in #134 . It should be really simple to specify java-arguments.
All options in the bash-script fail:
bashScriptConfigLocation := Some("/etc/default/ia-dashboard"),
debianMakeEtcDefault <<= (Keys.normalizedName, target in Universal, linuxEtcDefaultTemplate in Debian)
map { (name, tmpDir, source) =>
val scriptBits = TemplateWriter.generateScript(source, Seq.empty)
val script = tmpDir / "tmp" / "etc" / "default" / name
IO.write(script, scriptBits)
Some(script)
}, and -Xmx4098M
-Xms128M
-Dpidfile.path=/var/run/mukis-test.pid
And I'm not really getting my head around, how the bash-template puts the commanline-call together. Something like java $java_args -cp $classpath $app_args would be useful. Tested with 0.7.M1. |
Okay, this setup actually works: build.sbt bashScriptConfigLocation := Some("/etc/default/mukis-test"),
debianMakeEtcDefault <<= (Keys.normalizedName, target in Universal, linuxEtcDefaultTemplate in Debian)
map { (name, tmpDir, source) =>
val scriptBits = TemplateWriter.generateScript(source, Seq.empty)
val script = tmpDir / "tmp" / "etc" / "default" / name
IO.write(script, scriptBits)
Some(script)
}, /src/templates/etc-default -mem 2048
-Dpidfile.path=/var/run/mukis-test.pid |
cool. Maybe we need a constant for this: bashScriptConfigLocation := Some("/etc/default/mukis-test") So we aren't hard-coding that name, or we could just have the bash confg be the default for the server archetype. |
A default would be reasonable. The bash script takes care, if the file doesn't exists, so |
Fix #98 java server type includes /etc/default by default
Hey there,
I might be missing something in the documentation, but if I wanted to use the java server archetype (which generates its own upstart script), how can I specify custom JAVA_OPTS like my heap sizes? I've currently been using the java application archetype with my own init.d script while I figure this out.
Thanks for the plugin, it's been great for generating debian packages for deployment!
Blake
The text was updated successfully, but these errors were encountered: