|
From: <Bec...@em...> - 2006-08-17 20:10:10
|
Leif,
Your guess was correct. I was issuing the start service command while my
wrapper was still in the starting state. I switched to doing it from a
startup thread like you suggested and now it works. Thanks!
-Matthew
-----Original Message-----
From: wra...@li...
[mailto:wra...@li...] On Behalf Of Leif
Mortenson
Sent: Wednesday, August 16, 2006 7:08 PM
To: wra...@li...
Subject: Re: [Wrapper-user] starting other services from within wrapper
Matthew,
My guess is that you are attempting to start your child service while
the wrapper's service is still in the "starting" state. I have not tried
this personally, but it may be that the Windows Service Manager is only
capable of starting a single service at a time.
Have you set up any dependencies in the service configurations between
these services? If ServiceChild depends on ServiceParent, then it would
make sense that ServiceChild could not be started until the startup of
ServiceParent had completed.
You will probably have to set things up so that you launch a startup
thread which starts the child services AFTER the wrapper's service has
completed.
Are you using 3.2.0 or 3.2.1? If so, take a look at the
WrapperManager.sendServiceControlCode method. It can be used to start,
stop and control other services. Note that this method requires that a
SecurityManager be installed in the JVM for security reasons. There are
a number of ways to do this, but adding the following is the simplest:
wrapper.java.additional.1=3D-Djava.security.manager
wrapper.java.additional.2=3D-Djava.security.policy=3D../conf/wrapper.poli=
cy
I have attached a sample wrapper.policy file that will give the
wrapper.jar the permissions needed to launch and control your
application.
See the documentation for the
org.tanukisoftware.wrapper.security.WrapperServicePermission class.
I strongly suggest only giving permission to control the services that
you want to control. Being able to control any services can open you up
to some major security issues.
wrapper.policy (To start and stop a myservice service)
---
// Give Wrapper classes full permissions grant codeBase
"file:../lib/wrapper.jar" { permission java.security.AllPermission; };
// Give Application the permissions that it needs to run. All classes in
the // call stack must have this permission.
grant codeBase "file:../lib/-" {
permission org.tanukisoftware.wrapper.security.WrapperServicePermission
"myservice", "start,stop";
permission org.tanukisoftware.wrapper.security.WrapperServicePermission
"my*", "start,stop";
};
---
Cheers,
Leif
Bec...@em... wrote:
> Hi,
> I wrote an application using integration method 3. As my application=20
> runs it needs to start other Windows services. I accomplish this by=20
> exec'ing a "net start". It works fine when my service is started=20
> manually, but hangs after issuing the net start during automatic=20
> startup after an OS reboot. After my application fails to start due to
> timeout, the service that it was attempting to start finally starts.
> Increasing the timeout has not helped. It seems that the second=20
> service does not want to startup until my application has exited.
> Any suggestions on how to make this work would be greatly appreciated.
> Thanks,
> Matthew
------------------------------------------------------------------------
-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D=
121642
_______________________________________________
Wrapper-user mailing list
Wra...@li...
https://lists.sourceforge.net/lists/listinfo/wrapper-user
|