Skip to content

Commit

Permalink
…mmand-line-arguments-in-sbt-native-packager add in java.rmi.server.hostname
  • Loading branch information
tobyweston committed May 8, 2018
1 parent e8ca40d commit c6892d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ mappings in Universal ++= (proguard in Proguard).value.map(jar => jar -> ("lib/"
// point the classpath to the output from the proguard task
scriptClasspath := (proguard in Proguard).value.map(jar => jar.getName)

bashScriptExtraDefines ++= IO.readLines(sourceDirectory.value / "universal" / "conf" / "find_ip.sh")
bashScriptExtraDefines ++= IO.readLines(sourceDirectory.value / "universal" / "conf" / "find_ip.sh")

bashScriptExtraDefines += """addJava "-Djava.rmi.server.hostname=$(getIpAddress)""""
6 changes: 3 additions & 3 deletions src/universal/conf/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#
# cat application.ini | grep sed '/^\#/d;s/\r$//'
#
# To get the externally facing IP address, we use a function defined
# in another file which is pulled into the main script
# To get the externally facing IP address (java.rmi.server.hostname),
# we use a function defined in another file which is expanding via
# bashScriptExtraDefines (see https://bit.ly/2raOEN4)

-J-Xms256m
-J-Xmx512m
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=1616
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname="$(getIpAddress)"
-Dconfig.file=/home/pi/.temperature/temperature-machine.cfg

0 comments on commit c6892d7

Please sign in to comment.