You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Daniel Resare <no...@metamatrix.se> on 2003/09/18 15:58:11 UTC

[Daemon] some thoughts on commons-daemon

Hello friends

I saw that commons-daemon was promoted out of the sandbox ant I thought
I'd give it a spin. After having spent some time reading the source and
getting the SimpleDaemon to work I have some questions and thoughts.

1) The webpage for commsons-daemon says the issue handling is on a
scarab server, but having logged in there I found no issue category
matching commons-daemon, so I used http://nagoya.apache.org/bugzilla/
instead when filing some issues. Is that the correct thing to do?

2) I can't really say that I fully understand the daemon api.

Why does the Daemon implementor have access to it's DaemonController
instance? My guess is that it is to be able to communicate an exception
from inside of the daemon to its environment, but in that case a single
fail()-method that takes a Throwable or subclass of it would be enough.

Why is there no reload() method of the Daemon interface? It seems like
sending SIGHUP to jsvc translates to calls to stop() and start(), but
that is semantically different from how most programs other programs
handle SIGHUP.

What is the difference between stop() and destroy() in the Daemon
interface? 

3) Just out of curiosity, what does jsvc stand for?

Thats all for now
cheers
/noa


Re: [Daemon] some thoughts on commons-daemon

Posted by Daniel Resare <no...@metamatrix.se>.
tor 2003-09-18 klockan 16.07 skrev Remy Maucherat:
> Daniel Resare wrote:
> > Why is there no reload() method of the Daemon interface? It seems like
> > sending SIGHUP to jsvc translates to calls to stop() and start(), but
> > that is semantically different from how most programs other programs
> > handle SIGHUP.
> 
> I don't see a point. Stop + start is good enough IMO. reload adds 
> complexity.

At commons-daemon level I would argue that the complexty added is
minimal, but correctly impelmented at the java level a smart reload()
implementation would speed up changing configuration much compared to
shutting down and starting up the whole application again.

Compare using the manager servlet to reload a webapp in tomcat to
restart the whole tomcat instance :)

> 
> > What is the difference between stop() and destroy() in the Daemon
> > interface? 
> 
> Destroy is for releasing all resources. For example, a daemon may want 
> keep its server socket open on stop (since it can't be reopened unless 
> you are root - the main goal of daemon is to sove the 
> port-80-without-root problem).

To explain that semantic meaning to Daemon implementors will be a
challenge. Another interesting fact is that the current implementation
of commons-daemon doesn't ever call destroy(). After having called
stop() in the Daemon implementation it just calls System.exit().

port-80-without-root on restart/reload would be possible to solve nicely
however with a reload() method. *smile*

> 
> > 3) Just out of curiosity, what does jsvc stand for?
> 
> Java service maybe.

Ah, I should have figured. Sounds like an abbreviation from the good old
8.3 days.

/noa


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [Daemon] some thoughts on commons-daemon

Posted by Daniel Resare <no...@metamatrix.se>.
tor 2003-09-18 klockan 16.07 skrev Remy Maucherat:
> Daniel Resare wrote:
> > Why is there no reload() method of the Daemon interface? It seems like
> > sending SIGHUP to jsvc translates to calls to stop() and start(), but
> > that is semantically different from how most programs other programs
> > handle SIGHUP.
> 
> I don't see a point. Stop + start is good enough IMO. reload adds 
> complexity.

At commons-daemon level I would argue that the complexty added is
minimal, but correctly impelmented at the java level a smart reload()
implementation would speed up changing configuration much compared to
shutting down and starting up the whole application again.

Compare using the manager servlet to reload a webapp in tomcat to
restart the whole tomcat instance :)

> 
> > What is the difference between stop() and destroy() in the Daemon
> > interface? 
> 
> Destroy is for releasing all resources. For example, a daemon may want 
> keep its server socket open on stop (since it can't be reopened unless 
> you are root - the main goal of daemon is to sove the 
> port-80-without-root problem).

To explain that semantic meaning to Daemon implementors will be a
challenge. Another interesting fact is that the current implementation
of commons-daemon doesn't ever call destroy(). After having called
stop() in the Daemon implementation it just calls System.exit().

port-80-without-root on restart/reload would be possible to solve nicely
however with a reload() method. *smile*

> 
> > 3) Just out of curiosity, what does jsvc stand for?
> 
> Java service maybe.

Ah, I should have figured. Sounds like an abbreviation from the good old
8.3 days.

/noa


Re: [Daemon] some thoughts on commons-daemon

Posted by Remy Maucherat <re...@apache.org>.
Daniel Resare wrote:

> Hello friends
> 
> I saw that commons-daemon was promoted out of the sandbox ant I thought
> I'd give it a spin. After having spent some time reading the source and
> getting the SimpleDaemon to work I have some questions and thoughts.
> 
> 1) The webpage for commsons-daemon says the issue handling is on a
> scarab server, but having logged in there I found no issue category
> matching commons-daemon, so I used http://nagoya.apache.org/bugzilla/
> instead when filing some issues. Is that the correct thing to do?

Use BZ :)

> 2) I can't really say that I fully understand the daemon api.
> 
> Why does the Daemon implementor have access to it's DaemonController
> instance? My guess is that it is to be able to communicate an exception
> from inside of the daemon to its environment, but in that case a single
> fail()-method that takes a Throwable or subclass of it would be enough.

I don't know, as I don't use the Java API of the daemon.

> Why is there no reload() method of the Daemon interface? It seems like
> sending SIGHUP to jsvc translates to calls to stop() and start(), but
> that is semantically different from how most programs other programs
> handle SIGHUP.

I don't see a point. Stop + start is good enough IMO. reload adds 
complexity.

> What is the difference between stop() and destroy() in the Daemon
> interface? 

Destroy is for releasing all resources. For example, a daemon may want 
keep its server socket open on stop (since it can't be reopened unless 
you are root - the main goal of daemon is to sove the 
port-80-without-root problem).

> 3) Just out of curiosity, what does jsvc stand for?

Java service maybe.

Remy



Re: [Daemon] some thoughts on commons-daemon

Posted by Remy Maucherat <re...@apache.org>.
Daniel Resare wrote:

> Hello friends
> 
> I saw that commons-daemon was promoted out of the sandbox ant I thought
> I'd give it a spin. After having spent some time reading the source and
> getting the SimpleDaemon to work I have some questions and thoughts.
> 
> 1) The webpage for commsons-daemon says the issue handling is on a
> scarab server, but having logged in there I found no issue category
> matching commons-daemon, so I used http://nagoya.apache.org/bugzilla/
> instead when filing some issues. Is that the correct thing to do?

Use BZ :)

> 2) I can't really say that I fully understand the daemon api.
> 
> Why does the Daemon implementor have access to it's DaemonController
> instance? My guess is that it is to be able to communicate an exception
> from inside of the daemon to its environment, but in that case a single
> fail()-method that takes a Throwable or subclass of it would be enough.

I don't know, as I don't use the Java API of the daemon.

> Why is there no reload() method of the Daemon interface? It seems like
> sending SIGHUP to jsvc translates to calls to stop() and start(), but
> that is semantically different from how most programs other programs
> handle SIGHUP.

I don't see a point. Stop + start is good enough IMO. reload adds 
complexity.

> What is the difference between stop() and destroy() in the Daemon
> interface? 

Destroy is for releasing all resources. For example, a daemon may want 
keep its server socket open on stop (since it can't be reopened unless 
you are root - the main goal of daemon is to sove the 
port-80-without-root problem).

> 3) Just out of curiosity, what does jsvc stand for?

Java service maybe.

Remy



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org