You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2010/03/18 20:13:12 UTC
[DAEMON] Procrun documentation
As people may have noticed, I've been trying to update the procrun
documentation.
There are a few details that need clarifying:
- the Start/Stop mode can be jvm, Java or exe. What do these each do?
- how should a Java application be structured? I originally thought it
was the same as for jsvc, but that does not appear to be the case.
JSVC Direct mode requires the definition of the instance methods
init(String[]), start(), stop(), destroy().
Procrun by contrast requires static methods that take a (String[]) for
both start and stop commands. It does not seem to support an init()
method.
Does Procrun support Daemon mode? If so, how is it configured? I could
not get it to work with the SimpleDaemon example.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [DAEMON] Procrun documentation
Posted by sebb <se...@gmail.com>.
On 19/03/2010, Bill Barker <bi...@verizon.net> wrote:
>
>
> --------------------------------------------------
> From: "sebb" <se...@gmail.com>
> Sent: Thursday, March 18, 2010 1:18 PM
> To: "Commons Developers List" <de...@commons.apache.org>
> Subject: Re: [DAEMON] Procrun documentation
>
>
> > On 18/03/2010, Mladen Turk <mt...@apache.org> wrote:
> >
> > > On 03/18/2010 08:13 PM, sebb wrote:
> > >
> > > > As people may have noticed, I've been trying to update the procrun
> > > > documentation.
> > > >
> > > >
> > >
> > > Cool, thanks.
> > > But that doesn't mean you are free to delay the
> > > release forever :)
> > > Let's push the 1.0.3 out and work on improvements.
> > >
> > >
> >
> > Yes, fine.
> >
> > It was when I started trying to test the 1.0.3 build on Win/XP that I
> > realised that I had no idea how to. So I decided to document as I
> > found things out - and I think I'm nearly there.
> >
> >
> > > > There are a few details that need clarifying:
> > > > - the Start/Stop mode can be jvm, Java or exe. What do these each do?
> > > >
> > > >
> > >
> > > jvm loads the jvm in process, java is just like .exe but it
> > > figures out the .exe from default JVM installed.
> > >
> > >
> >
> > So effectively Java mode figures out the value for StartImage/StopImage?
> >
> >
>
> Yes, it will override any user supplied StartImage or StopImage.
>
>
>
> > Are the options Classname and Method used in Java mode?
> > Or just Classname? Or neither?
> >
> >
>
> Java mode uses ClassPath, Classname, options, JvmMs, JvmMx, JvmSs (as well
> as StartParams/StopParams). Since it is executing java.exe, the Method is
> ignored (it will use 'static void main(String [])').
>
>
> > Presumably these are not used in exe mode, as they would not make sense.
> >
> >
>
> Yes, exe is not restricted to running Java. It can be used to wrap any
> .exe file as a service. As a result, the entire command line needs to be
> specified in StartParams/StopParams, and the Java specific options like
> Classpath, StartClass, StopClass, etc are ignored. I've used this in the
> past to convert other non-java programs into services.
>
>
> >
> > > >
> > > > Does Procrun support Daemon mode? If so, how is it configured? I could
> > > > not get it to work with the SimpleDaemon example.
> > > >
> > > >
> > >
> > > It doesn't. procrun does not use java daemon code.
> > >
> >
> > OK.
> >
> > So Procrun and Jsrv have no common API at all?
> >
> >
>
> They have no common API at all. This isn't too surprising, since they
> exist to fill two completely non-overlapping needs.
>
> Jsvc is so that the application (e.g. Tomcat) can perform some privileged
> operations as root (e.g. bind to port < 1024), and then switch identity to a
> non-privileged user. Since Windows doesn't have the concept of privileged
> ports, there isn't much use for it on Windows, so it largely remained
> non-functional in Windows until Mladen fixed it in 1.0.2.
>
> Procrun is to allow Windows users to wrap (mostly) Java applications (e.g.
> Tomcat) as a service that can be started when the machine boots and will
> continue to run with no user logged onto the machine. On *nix machines
> there isn't much use for this, since you just place a script in /etc/init.d.
>
OK, thanks, I think I've got there now.
I've added your comments to the procrun page.
>
> >
> > >
> > > Regards
> > > --
> > > ^TM
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> dev-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: dev-help@commons.apache.org
> > >
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [DAEMON] Procrun documentation
Posted by Bill Barker <bi...@verizon.net>.
--------------------------------------------------
From: "sebb" <se...@gmail.com>
Sent: Thursday, March 18, 2010 1:18 PM
To: "Commons Developers List" <de...@commons.apache.org>
Subject: Re: [DAEMON] Procrun documentation
> On 18/03/2010, Mladen Turk <mt...@apache.org> wrote:
>> On 03/18/2010 08:13 PM, sebb wrote:
>>
>> > As people may have noticed, I've been trying to update the procrun
>> > documentation.
>> >
>> >
>>
>> Cool, thanks.
>> But that doesn't mean you are free to delay the
>> release forever :)
>> Let's push the 1.0.3 out and work on improvements.
>>
>
> Yes, fine.
>
> It was when I started trying to test the 1.0.3 build on Win/XP that I
> realised that I had no idea how to. So I decided to document as I
> found things out - and I think I'm nearly there.
>
>> > There are a few details that need clarifying:
>> > - the Start/Stop mode can be jvm, Java or exe. What do these each do?
>> >
>> >
>>
>> jvm loads the jvm in process, java is just like .exe but it
>> figures out the .exe from default JVM installed.
>>
>
> So effectively Java mode figures out the value for StartImage/StopImage?
>
Yes, it will override any user supplied StartImage or StopImage.
> Are the options Classname and Method used in Java mode?
> Or just Classname? Or neither?
>
Java mode uses ClassPath, Classname, options, JvmMs, JvmMx, JvmSs (as well
as StartParams/StopParams). Since it is executing java.exe, the Method is
ignored (it will use 'static void main(String [])').
> Presumably these are not used in exe mode, as they would not make sense.
>
Yes, exe is not restricted to running Java. It can be used to wrap any .exe
file as a service. As a result, the entire command line needs to be
specified in StartParams/StopParams, and the Java specific options like
Classpath, StartClass, StopClass, etc are ignored. I've used this in the
past to convert other non-java programs into services.
>> >
>> > Does Procrun support Daemon mode? If so, how is it configured? I could
>> > not get it to work with the SimpleDaemon example.
>> >
>> >
>>
>> It doesn't. procrun does not use java daemon code.
>
> OK.
>
> So Procrun and Jsrv have no common API at all?
>
They have no common API at all. This isn't too surprising, since they exist
to fill two completely non-overlapping needs.
Jsvc is so that the application (e.g. Tomcat) can perform some privileged
operations as root (e.g. bind to port < 1024), and then switch identity to a
non-privileged user. Since Windows doesn't have the concept of privileged
ports, there isn't much use for it on Windows, so it largely remained
non-functional in Windows until Mladen fixed it in 1.0.2.
Procrun is to allow Windows users to wrap (mostly) Java applications (e.g.
Tomcat) as a service that can be started when the machine boots and will
continue to run with no user logged onto the machine. On *nix machines
there isn't much use for this, since you just place a script in /etc/init.d.
>>
>> Regards
>> --
>> ^TM
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [DAEMON] Procrun documentation
Posted by sebb <se...@gmail.com>.
On 18/03/2010, Mladen Turk <mt...@apache.org> wrote:
> On 03/18/2010 08:13 PM, sebb wrote:
>
> > As people may have noticed, I've been trying to update the procrun
> > documentation.
> >
> >
>
> Cool, thanks.
> But that doesn't mean you are free to delay the
> release forever :)
> Let's push the 1.0.3 out and work on improvements.
>
Yes, fine.
It was when I started trying to test the 1.0.3 build on Win/XP that I
realised that I had no idea how to. So I decided to document as I
found things out - and I think I'm nearly there.
> > There are a few details that need clarifying:
> > - the Start/Stop mode can be jvm, Java or exe. What do these each do?
> >
> >
>
> jvm loads the jvm in process, java is just like .exe but it
> figures out the .exe from default JVM installed.
>
So effectively Java mode figures out the value for StartImage/StopImage?
Are the options Classname and Method used in Java mode?
Or just Classname? Or neither?
Presumably these are not used in exe mode, as they would not make sense.
> >
> > Does Procrun support Daemon mode? If so, how is it configured? I could
> > not get it to work with the SimpleDaemon example.
> >
> >
>
> It doesn't. procrun does not use java daemon code.
OK.
So Procrun and Jsrv have no common API at all?
>
> Regards
> --
> ^TM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [DAEMON] Procrun documentation
Posted by Mladen Turk <mt...@apache.org>.
On 03/18/2010 08:13 PM, sebb wrote:
> As people may have noticed, I've been trying to update the procrun
> documentation.
>
Cool, thanks.
But that doesn't mean you are free to delay the
release forever :)
Let's push the 1.0.3 out and work on improvements.
> There are a few details that need clarifying:
> - the Start/Stop mode can be jvm, Java or exe. What do these each do?
>
jvm loads the jvm in process, java is just like .exe but it
figures out the .exe from default JVM installed.
>
> Does Procrun support Daemon mode? If so, how is it configured? I could
> not get it to work with the SimpleDaemon example.
>
It doesn't. procrun does not use java daemon code.
Regards
--
^TM
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org