|
From: Leif M. <le...@ta...> - 2003-07-10 10:12:52
|
Chris, I thought I covered both of your questions in my previous post. >So the two main questions I have is >- Can I make one service spark off another service? > I covered two possible ways to do this below. >- Can I do this programmatically without having to rely on configuration >files? > Yes and no. As I said before. The Wrapper requires a configuration file, but the file can be empty. You can define all properties by using a very long command line. For example Wrapper.exe -c empty.conf wrapper.java.command=java wrapper.debug=true <etc> See: http://www.tanukisoftware.org/doc/english/props-command-line.html Let me know what you end up using or if you have any more questions. Cheers, Leif >Chris, > Not sure exactly what you are wanting to do. But individual NT >Services are >independent of each other. If you wanted to start a second service when > >the first >one was started, your would want to install them both normally. Then >you would >trigger the startup of the second service from within the first using >the java.lang.Runtime.exec methods and the "net" command with "start", >"{service name}" arguments. Have not tested this, but it should work. >In >Wrapper v3.0.4, you will also be able to execute Wrapper.exe with a "-t" >parameter to start the service. > > If you simply want to launch a second JVM from a Java application >running as >a service, then you can do so by, once again, using the >java.lang.Runtime.exec >method. Only this time, execute Java.exe with all the arguments that >apply. This >second JVM will be a child process of the first so it will be a part of >the original >service. The problem here is that you have to be careful about how you >shutdown >the service to make sure that the child JVM is always killed. Failure >to do so will >result in a zombie process that I believe you will have to reboot to get > >rid of. > > If you want to execute a copy of the Wrapper from the exec method, >you should >be able to specify any property in the wrapper.conf file from the >command line. >The Wrapper always requires that a wrapper.conf exists. But if >everything is on >the command line, then the conf file can be empty. This would result in > >a very long >command line however, so I would only put the parameters that need to be >dynamic on the command line. > >Let me know if none of these answers actually answers your question. > >Cheers, >Leif > > > > |