|
From: Leif M. <lei...@ta...> - 2009-07-17 06:20:38
|
Lars, Is this something that was working on XP? Normally when the Wrapper is installed as a service, it is running as the System user. I need to very whether or not that use is able to start and stop other services. The ability to do so is fairly restricted. I would expect that you may need to configure the Wrapper to run as a specific account before these functions would be available. http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html I would also suggest using the Wrapper's methods for controlling other services. They require that you set up a simple policy file for security reasons, but they are pretty easy to use. http://wrapper.tanukisoftware.org/doc/english/security-model.html WrapperManager.sendServiceControlCode("myservice", WrapperManager.SERVICE_CONTROL_CODE_START); WrapperManager.sendServiceControlCode("myservice", WrapperManager.SERVICE_CONTROL_CODE_STOP); See the javadocs for more information: http://wrapper.tanukisoftware.org/doc/english/javadocs.html I will play around with this on our Windows 7 test box as well. Also, which service are you attempting to restart? If it the current Java service, this can be done by calling: WrapperManager.restart(); Cheers, Leif On Thu, Jul 16, 2009 at 10:15 PM, Lars Schnoor<Lar...@if...> wrote: > Hi > I am using the wrapper version 3.2.3 on Windows 7. > I installed it using the batch files without problems. I can start and stop > it without problems using Services. I need however to restart it from a Java > application, I tried Runtime.exec("net stop servicename") from my > application, but it does not work. When I try "net stop servicename" from a > Command Prompt I get the following error message: > System error 5 has occurred. > > Access is denied > > I read the post about getfacl, but getfacl does not seem to be part of > Windows 7. I assume that the problem also exists on Windows Vista, I haven't > had problems on my Windows XP. If there are other options to restart the > service than calling Runtime.exec("net stop servicename") I would be happy > to hear about them. > > Lars |