@@ -98,7 +98,7 @@ var Webserver = geneos.Component{
98
98
`maxmem=1024m` ,
99
99
`autostart=true` ,
100
100
// customised cacerts - can be to a shared one if required
101
- `truststore={{join . home "cacerts"}}` ,
101
+ `truststore={{join "${config: home}" "cacerts"}}` ,
102
102
},
103
103
104
104
Directories : []string {
@@ -366,12 +366,28 @@ func (w *Webservers) Command() (args, env []string, home string) {
366
366
// "-Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false",
367
367
"-XX:+HeapDumpOnOutOfMemoryError" ,
368
368
"-XX:HeapDumpPath=/tmp" ,
369
- "-jar" , base + "/geneos-web-server.jar" ,
370
- "-dir" , base + "/webapps" ,
369
+ }
370
+
371
+ javaopts := strings .Fields (cf .GetString ("java-options" ))
372
+ args = append (args , javaopts ... )
373
+
374
+ if truststorePath := cf .GetString ("truststore" ); truststorePath != "" {
375
+ args = append (args , "-Djavax.net.ssl.trustStore=" + truststorePath )
376
+ }
377
+
378
+ // fetch password as string as it has to be exposed on the command line anyway
379
+ if truststorePassword := cf .GetString ("truststore-password" ); truststorePassword != "" {
380
+ args = append (args , "-Djavax.net.ssl.trustStorePassword=" + truststorePassword )
381
+ }
382
+
383
+ // -jar must appear after all options are set otherwise they are
384
+ // seen as arguments to the application
385
+ args = append (args ,
386
+ "-jar" , base + "/geneos-web-server.jar" ,
387
+ "-dir" , base + "/webapps" ,
371
388
"-port" , cf .GetString ("port" ),
372
389
"-maxThreads 254" ,
373
- // "-log", LogFile(c),
374
- }
390
+ )
375
391
376
392
tlsFiles := instance .Filepaths (w , "certificate" , "privatekey" )
377
393
if len (tlsFiles ) == 0 || tlsFiles [0 ] == "" {
@@ -383,15 +399,6 @@ func (w *Webservers) Command() (args, env []string, home string) {
383
399
args = append (args , "-ssl" , "true" )
384
400
}
385
401
386
- if truststorePath := cf .GetString ("truststore" ); truststorePath != "" {
387
- args = append (args , "-Djavax.net.ssl.trustStore=" + truststorePath )
388
- }
389
-
390
- // fetch password as string as it has to be exposed on the command line anyway
391
- if truststorePassword := cf .GetString ("truststore-password" ); truststorePassword != "" {
392
- args = append (args , "-Djavax.net.ssl.trustStorePassword=" + truststorePassword )
393
- }
394
-
395
402
return
396
403
}
397
404
0 commit comments