|
From: Christian M. <chr...@ta...> - 2012-07-10 06:03:35
|
Hello Patrick, thank you for your mail. I can understand your request very well, but unfortunately it's currently not possible to pass any additional parameters to the service when starting from the command line. Actually this is not a completely trivial task, since the command line of the service is being set during the installation. When you start the Wrapper in order to start a service, the Wrapper interacts with the Windows Service Control Manager and tells it to start the Service. If you want to pass an additional parameter to the JVM during installation via the command line, then this can be done for instance rather easily using the '--' parameter: bin\wrapper.exe -i ..\conf\wrapper.conf -- myParam1 myParam2 [...] Everything preceding the '--' will be passed through the Wrapper to the Java Application. Now every time the service is being started, the parameters specified during installation are passed to your application. If you now want to alter those parameters each time you start the Service, you actually would have to update the Service each time. This can be done similar to the procedure as above, using the parameter '-u' (update) bin\wrapper.exe -u ..\conf\wrapper.conf -- myNewParam1 myNewParam2 [...] and then start the service, e.g.: bin\wrapper.exe -t ..\conf\wrapper.conf We could probably add a new parameter to update the service each time it starts a service (and parameters are being passed through) However, please note that updating a service requires additional security permissions than only starting (SERVICE_QUERY_CONFIG and SERVICE_CHANGE_CONFIG privileges are additionally required). Another way of implementing something similar would be to define a "parameter file". All additional parameters would be written into that file, e.g.: myPara1 myPara2 [...] and in the conf file something like this would be specified: wrapper.java.app.parameterfile=myParameterFile.txt This way, the same functionally would become available on non-Windows systems as well, rather than implementing something very platform specific... Please let me know what you think about my suggestions. Thank you, Christian Mueller Tanuki Software, Ltd. On Fri, Jul 6, 2012 at 1:01 PM, Patrick Burghardt <PBu...@ec...>wrote: > We have parameters for our java application set up in our config files > and those are working fine. But we want to be able to send an additional > parameter when we start the service. Can we send a parameter from the > command line when starting a service? And how do we recognize that this is > a parameter that we want to send on to the java application?**** > > ** ** > > That is, I want to be able to start the service with a command such as “sc > start service1 parm1=potatoes” and have “potatoes” sent as a specific > argument to my java application.**** > > ** ** > > Thanks.**** > > ** ** > Patrick Burghardt Software Engineer III > > [image: Ecova] <http://www.ecova.com/> > > > > PBu...@ec... > T 513 763 3107 > > > <http://twitter.com/#%21/ecovainc> <http://www.linkedin.com/groups/Ecova-Inc-4117932> > <https://www.facebook.com/ecovainc> <http://www.youtube.com/ecovainc> <http://www.ecova.com/insider> > To learn more visit ecova.com > > CONFIDENTIALITYNOTICE: This email transmittal and any accompanying > attachments contains information from sender which is business sensitive, > proprietary, confidential and may be legally privileged. The information is > only for the use of the intended recipient(s). If you are NOT the intended > recipient: 1. Do not read, copy, use or disclose this communication to > others; 2. Immediately notify the sender of the error by return email or > call > 509.329.7606; and 3. Delete the original file from your computer system > and destroy all copies of the transmittal in any form, including archived > copies. > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > |