[defines] ;This section defines variables, which can be used elsewhere in the ini file ;JSL will first look in the normal environment then in the system environment of the registry as a fallback. ;A variable referencing itself e.g. "PATH=%PATH%;c:\java\test" will result in an import from the environment. ;Any variable not in the defines section will result in a environment lookup as well. ;Variable substitution is possible in any value in the ini file ;% is escaped by %% ;PATH= %PATH% ;JAVA = %JAVA_HOME% ;P1 = d:\java\test\jsl_0_9_9p ;P2 = %P1% ;Comma seperated list of variables to be exported to the environment ;Supersedes the "path" variable further down. ;Do not import variables if you also export them as sequence of operations is undefined ;export = CLASSPATH,PATH TESTHOME=D:\private\java\jsl_0_9_9x\contribution\batch [service] appname = TelnetEcho servicename = TelnetEcho displayname = TelnetEcho servicedescription = Description for Telnet Echo ;Size of internal buffer for string handling ;increase if you use very long command line parameters e.g. a very long classpath stringbuffer = 64000 ; Specify the configuration batch file to run before running the Java application. ; Any output of the batch will be parsed in the format name=value and will be used to set the environment of the Java application ; To avoid parsing errors write the batch in the following format. ; ; @echo off ; ; echo ENVIRONMENT ; set ; ; The batch file will run AFTER the |defines] section has been evaluated and AFTER the log file and stdout redirect have been initialized ;configbatch = %TESTHOME%\test.bat ; Specify the operating directory of the configuration batch file. ; Must be configured for the batch file to run ; Note that this will NOT resolve against the working directory (wrkdir) set later. This must be an absolute path. ;configbatchhome = %TESTHOME% ;OBSOLETE but supported ;port used to communicate stop command to JVM ;Must be unique for each JSL instance installed ;This option is ignored if a stop method is defined further down ;stopport = 8465 ;delay n milliseconds to start the Java VM ;Default is no start delay ;startdelay = 10000 ;service dependencies can be added ;as a comma separated string "dep1,dep2" ;dependencies=depend2 ;service start type ;auto demand disabled ;default is auto starttype=auto ;Allow interaction with desktop ;This is a service configuration flag; default is false ;interactwithdesktop = false ;load ordering group loadordergroup=someorder ;account under which service runs ;default is system ;account=mroescht-PC\mroescht ;password for above account ;system need not provide a password ;obfuscation of password is not supported. It is actually not needed. ;The password specified here is ONLY used during the jsl -install command. It can (and should) be deleted after installation. ;password=somepwd ;Allocate a console and register a console event handler to catch shutdown events. ;Default is true; options are FALSE TRUE false true YES NO yes no ;This option has two effects: ;1. If active it catches the logoff events and prevents the service from erroneously stopping in this case. ;2. It creates a console window if interaction with the desktop is allowd. ;Effect 1 can be achieved in Java 1.3.1 and higher by using the -Xrs option. ;Effect 2 may or may not be desired. useconsolehandler=false ;Call . through JNI so stop the JVM. ;This can be used an alternative to the ServiceStopper ;When all three parameters are defined the JSL will try to use JNI to stop the service. ;If not it will use a tcp/ip connection to the stopport. ;The simplest way to use this functionality is to use the Systen.exit() call as specified below. ;Nevertheless you can call any static method in your code. ;The method called is expected to terminate the JVM one way or the other. It can directly ;call System.exit() or make another Thread do it make the main method return. ;The method can return imediately if desired. If the JVM doesn't stop another attempt can be made to ;stop the service at a later time. stopclass=java/lang/System stopmethod=exit ;Take care to specify the right signature for your method. void System.exit( int code ) has ;the sifnature specified below. void myMethod() has the signature ()V. Please refer to the ;JNI documentation for details. stopsignature=(I)V ;Parameters can be passed in "stopparam". ;Note that parameter passing is only implemented for the special case that the signature of the ;method is (String[]). Generic parameter passing is cumbersome to implement in C so I choose ;to implement only the most common case. ;stopsignature=([Ljava/lang/String;)V ;The parameter list is parsed into an array. Delimiters are spaces or quoted strings. ;stopparams=STOP "OR NOT STOP" ;Name and signature of service pause method. Will be called on a SERVICE_CTRL_PAUSE event. ;Please note that unless you have configured all pause and continue arguments ;you will not see the pause button enbaled in the service control manager GUI ;pauseclass=com.roeschter.jsl.TelnetEcho ;pausemethod=pause ;pausesignature=()V ;pauseparams= ;Name and signature of service continue method. Will be called on a SERVICE_CTRL_CONTINUE event. ;Please note that unless you have configured all pause and continue arguments ;you will not see the pause button enbaled in the service control manager GUI ;contclass=com.roeschter.jsl.TelnetEcho ;contmethod=cont ;contsignature=()V ;contparams= ;Value of the PATH environment variable being set by the service. ;Set this if teh default enbvironment path is not suitable ;path=c:\util ;Redirect C level stdout and stderr to the specified files ;Please note that those are diffrent files then the ones used below for ;Java level stdout and stderr ;Default is no redirection ;Use the pattern below to timestamp/roate log files. Please note the %% escapes ;Applies to stdout and the debug logfile. If not present there will be no log file rotation. logtimestamp = "%%Y-%%m-%%d" ;stdout=c:\temp\stdout.log stdoutappend=no ;stderr=c:\temp\stderr.log stderrappend=no ;redirect log to file for errors and debugging - you will only see output here if debugging is enabled ;Use debug version or set _JAVA_LAUNCHER_DEBUG environment variable logfile = C:\temp\jslmy.log ;Forces debugging mode ;Default is false debug=false ;Redirect JAVA level System.out and System.err to the specified files ;This simply sets new output streams for System.out and System.err after ;the JVM is initialized but before the main method is called. ;You might find that this option has no effect at all for some applications, as the ;JAVA application is of course free to redirect System.out and System.err ;to some other log mechanism. ;Default is no redirection ;Default is to overwrite file ;systemout=c:\systemout.log ;systemoutappend=no ;systemerr=c:\systemerr.log ;systemerrappend=no ;Explicitely call this method and wait for it to return before setting the service to status running ;This method will be called before the main method ;After we call this method the service will only be set to SERVICE_RUNNING once it returns ;This is started in a seperate thread and will not prevent the main method from being called ;Uncomment the confirmrunclass to enable ;confirmrunclass=com.roeschter.jsl.TelnetEcho confirmrunmethod=confirmRunning confirmrunsignature=()V confirmrunparams= ;This method will be called before the main method of the start class specified on command line ;but after the JVM is fully initialized and stdout and stderr redirection have been performed. ;This method must return! It is called from the same thread as the main method. ;In order for the normal JVM start behaviour to continue this method must return 0. ;It may legally return any other value or throw any exception, which in both cases will result in ;a regular termination of the JVM much in the same way as if an uncatched exception had been thrown ;in the main method. ;It may legally start other threads in the JVM, which will behave in the same way as started from ;the main method. ;In fact you will be able to produce pretty much the same behaviour as calling the static method first in ;your main method ;The example method present here is a scheduler which will in turn run the code specified ;in its modules list. Some utilities are provided. ;Uncomment the premainclass to enable ;premainclass=com/roeschter/jsl/PreMainScheduler premainmethod=run premainsignature=()I premain.modules=threaddump premain.threaddump.class=com.roeschter.jsl.ThreadDumpListener premain.threaddump.method=start premain.threaddump.wait=3000 premain.threaddump.critical=no premain.threaddump.interface=127.0.0.1 ;Report service stopped on exit of main thread ;you might want to set this to yes if your service terminates "silently" ;It is recommended that a service is stopped by calling System.exit() at some time, ;either externally or internally. This provides a nice and clean shutdown hook. ;If the service terminates silently by just ending the last thread this might result ;in the service manager not recognizing the fact and denying restart. Use yes in this case. ;It should usually be safe to use reportservicestoppedonmainthreadexit=true ;even if you use other threads then main. The shutdown code will wait for non daemon threads to stop ;I can't remember why I made this parameter optional. It must have been useful for some people or in some situations ;Default is no ;reportservicestoppedonmainthreadexit = no ;Behaviour in case of JVM exiting with an error ;Define whether an execption in the main method should be considered an error ;Use this exit code in case of an exception. ;exceptionerrorcode=0 ;Desired behaviour for a non zero exit code (including exceptions as specified above) ;Options: ;ignore terminate without error (default) ;returncode exit with error code reported by the JVM to to the service manager ;fatal don't report regular service stop to service manager making it believe ;a fatal error had occured in the service (this is sometimes desirable if fatal error ;recovery mechanisms are in place) ;onexiterror=fatal ;Use this executable for registering the service. ;Default is the executable used for installation ;modulepath="e:\java\test\jsl_0_9_9e\release\jsl.exe" ;Configures the the Windows service failure actions. ;The below is not JSL functionality, but rather Windows Server functionality, which can be overridden by the server administrator. ;You need to configure exceptionerrorcode and onexiterror as of above to create the expected behavior ;Configuration will be made at install time (jsl -install). ;For changes to become effective you need to reconfigure JSL (jsl -configure) ;See MSDN for details: https://msdn.microsoft.com/de-de/library/windows/desktop/ms681988%28v=vs.85%29.aspx ; ;The service control manager counts the number of times each service has failed since the system booted. ;The count is reset to 0 if the service has not failed for ResetPeriod seconds. ;When the service fails for the Nth time, the service controller performs the action specified in element [N-1] of the actions array. ;If N is greater than cActions, the service controller repeats the last action in the array. ;The time after which to reset the failure count to zero if there are no failures, in seconds. ;Specify INFINITE to indicate that this value should never be reset. failureactions_resetperiod=300000 ;The message to be broadcast to server users before rebooting in response to the SC_ACTION_REBOOT service controller action. failureactions_rebootmsg="Server going down due to Java service failure" ;The command line of the process for the CreateProcess function to execute in response to the SC_ACTION_RUN_COMMAND service controller action. ;This process runs under the same account as the service. failureactions_command="HelloWorld -seriously" ;The number of elements in the lpsaActions array. ;Settings 0 deactivates. Non configuring enough action_type and action_delay wil result in JSL issueing an error. failureactions_actions=0 ;SC_ACTION_NONE 0 = No action. ;SC_ACTION_RESTART 1 = Restart the service. ;SC_ACTION_REBOOT 2 = Reboot the computer. ;SC_ACTION_RUN_COMMAND 3 = Run a command. action0_type=1 ;The time to wait before performing the specified action, in milliseconds. action0_delay=10000 ;Setting failureactions_actions=4 will result in the following behavior: ;Service restart will be tried 3 times with 1 10s delay each. On the 4th failure the server will rebooting action1_type=1 action1_delay=10000 action2_type=3 action2_delay=10000 action3_type=2 action3_delay=10000 [java] ;Path to the java runtime used ;The path may be relative to the working directory. E.g. .\jdk8 ;jrepath=D:\java\jdk18_64 ;Type of jvm to be used. Alternative mechanism to specifiying -client or -server on the command line. ;Can use any JVM name, which is diffrent from the command line which will only allow -client and -server ;Useful when using a JVM diffrent from Suns implementation. ;Jvmtype can be a comma seperated list. JSL will first find a JVM installation location. THEN it will load the first ;type of jvm in the list it can find. It will NOT search in alternative JVM locations for alternative jvm types. ;Be careful what JVM is actuallay installed and used before you report a bug on this feature. ;Default is "server,client,hotspot,classic" ;jvmtype=server,client,hotspot,classic ;Locations to search for the JRE as comma separated list ;Default is search in sequence through: path,local,registry,envpath ;You can reorder and drop search location ;path=Use the location specified in the jrepath option above (search in PATH environment is envpath) ;local=search for a jvm co-located with JSL (in a subdirectory \bin or \jre\bin) ;registry=Find a JVM in the registry. Registry search can be further customized. See below. ;envpath=search for JVM in the PATH environment variable (off by default) - Will only consider the first java.exe it finds in the path. ;jvmsearch=path,local,registry,envpath ;In built registry paths that will be searched (from code) ;#define JRE_KEY_ZULU "Software\\Azul Systems\\Zulu" ;#define JRE_KEY_9 "Software\\JavaSoft\\JRE" ;#define JDK_KEY_9 "Software\\JavaSoft\\JDK" ;#define JRE_KEY_ADOPT "Software\\AdoptOpenJDK\\JRE" ;#define JDK_KEY_ADOPT "Software\\AdoptOpenJDK\\JDK" ;#define JRE_KEY_ADOPTIUM "Software\\Eclipse Adoptium\\JRE" ;#define JDK_KEY_ADOPTIUM "Software\\Eclipse Adoptium\\JDK" ;#define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment" ;#define JDK_KEY "Software\\JavaSoft\\Java Development Kit" ;Custom registry keys to search. Comma seperated. This list is used first before the inbuilt list ;customregistrypaths=Software\Eclipse Adoptium\JDK ;Searching for various types of JVM in the registry ;Find a JRE ;registryfindjre=yes ;Find a JDK ;registryfindjdk=yes ;Search in nonstandard registry path used by AZUL ;registryfindazul=yes ;Search in nonstandard registry path used by AdoptOpenJDK ;registryfindadoptopenjdk=yes ;No effect future use ;registryfindcorretto=yes ;Search the default registry path used by SUN/Oracle and other well behaved installers ;registryfindoracle=yes ;registryfindj9=no ;Allowed JVM versions ;Comma seperated list - substring matches - e.g. 9.0 matches 9.0.1.1 ;Java 2 to Java 8 version string are "1.2.x" ... "1.8.x" ;Since Java 9 the version string is "9.0.x.y" ;Azul Zulu uses version strings like "8.x.y.z" in the registry - you may need to specify "8,1.8" to allow both registry and version string match to pass ;Default is: ANY jvmversionallowed=ANY ;working directory ;If the working directory path starts with a "." it will be substituted with the directory where the .ini file is located ;This is neccessary because a service does not inherit a working directory from the shell. ;All other paths will resolve against the working dir once it is set. ;wrkdir=c:\java\test\jsl_0_9_9r\release wrkdir=. ;The java command line ;The entry method below using a parameter list still works but the command line variant is more convenient. ;Everything separated by whitespace on a java command line is broken down into a parameter here. ;You don't need to care about quotes ;around strings containing spaces here. e.g. cmdline = -cp "..\..\src" com.roeschter.jsl.TelnetEcho ;OBSOLETE but supported alternative for passing parameters. ;May be useful if you are generating this file programatically. ;the number of paramters passed to the java application ;parameters must be named param00, param01 ... ;Please note that each command line parameter has to go on it's own parameter value here! ;The JVM expects a preparsed array of parameters. ;params = 3 ;param00 = -cp ;param01 = D:\java\test\jsl_0_9_9r\src ;param02 = com.roeschter.jsl.TelnetEcho ;params = 7 ;param00 = -cp ;param01 = c:\java\test\jsl_0_9_9g\src ;param02 = -Dcom.sun.management.jmxremote ;param03 = -Dcom.sun.management.jmxremote.port=9696 ;param04 = -Dcom.sun.management.jmxremote.authenticate=false ;param05 = -Dcom.sun.management.jmxremote.ssl=false ;param06 = com.roeschter.jsl.TelnetEcho