You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bill Barker <wb...@wilshire.com> on 2003/06/20 06:33:28 UTC

commons-sandbox/daemon

Ok, yes I know that this should go to commons-dev, but I don't monitor that
list as closely and all of the active developers hang-out here.

I would like to make some changes to native/unix/native, and (keeping with
commons conventions) should ask first.  I already have commons-sandbox
karma, so that's not an issue.

1) I want to call setsid (on platforms that support it) after the detach,
since evil things happen if I don't (at least on RH Linux).
2) I want to add a -outfile and -errfile to the config options (consistant
with procrun, and both defaulting to /dev/null).  stdin will get redirected
to /dev/null, and stdout & stderr will get redirected to the values of the
variables.  If I can get it to work, I'd also like to add the special values
"&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping and
starting Tomcat with jsvc hangs my ssh session on logout, since it still has
open files to the pty.
3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile &1 \
    ).




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


Re: commons-sandbox/daemon

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Bill Barker wrote:
> ----- Original Message -----
> From: "jean-frederic clere" <jf...@fujitsu-siemens.com>
> To: "Tomcat Developers List" <to...@jakarta.apache.org>
> Sent: Friday, June 20, 2003 12:21 AM
> Subject: Re: commons-sandbox/daemon
> 
> 
> 
>>Bill Barker wrote:
>>
>>>Ok, yes I know that this should go to commons-dev, but I don't monitor
> 
> that
> 
>>>list as closely and all of the active developers hang-out here.
>>>
>>>I would like to make some changes to native/unix/native, and (keeping
> 
> with
> 
>>>commons conventions) should ask first.  I already have commons-sandbox
>>>karma, so that's not an issue.
>>>
>>>1) I want to call setsid (on platforms that support it) after the
> 
> detach,
> 
>>>since evil things happen if I don't (at least on RH Linux).
>>
>>-1 : The idea is to be root until we call the start. (See child).
>>Tell what goes wrong we should fix it.
> 
> 
> I don't understand.  setsid doesn't change the identity, it just puts the
> (forked) process into a new session, and divorces it from the pty.  The
> process is still running as "root".  It's similar to (or, rather, a subset
> of) the Linux "daemon" API call.  Since it is good enough for Apache/httpd,
> I really didn't expect any controversy on this one.

Oops I was a bit to fast in my answer and have though of a setuid().
Of course the setsid() is _missing_ in the actual daemon code.

So you have my +1, sorry for the bad comment.

> 
> The problem is that the monitor still gets signals from my terminal session
> (including HUP when I try to logout).  Similar to below, it hangs my ssh
> session, since there is still an active proc in the same session as mine
> when I try to logout.
> 
> 
>>>2) I want to add a -outfile and -errfile to the config options
> 
> (consistant
> 
>>>with procrun, and both defaulting to /dev/null).  stdin will get
> 
> redirected
> 
>>>to /dev/null, and stdout & stderr will get redirected to the values of
> 
> the
> 
>>>variables.  If I can get it to work, I'd also like to add the special
> 
> values
> 
>>>"&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping
> 
> and
> 
>>>starting Tomcat with jsvc hangs my ssh session on logout, since it still
> 
> has
> 
>>>open files to the pty.
>>
>>+1
>>
>>
>>>3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
>>>    -outfile $CATALINA_HOME/logs/catalina.out \
>>>    -errfile &1 \
>>>    ).
>>
>>+1
>>
>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
> 
> 
> 



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


Re: commons-sandbox/daemon

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: "jean-frederic clere" <jf...@fujitsu-siemens.com>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Friday, June 20, 2003 12:21 AM
Subject: Re: commons-sandbox/daemon


> Bill Barker wrote:
> > Ok, yes I know that this should go to commons-dev, but I don't monitor
that
> > list as closely and all of the active developers hang-out here.
> >
> > I would like to make some changes to native/unix/native, and (keeping
with
> > commons conventions) should ask first.  I already have commons-sandbox
> > karma, so that's not an issue.
> >
> > 1) I want to call setsid (on platforms that support it) after the
detach,
> > since evil things happen if I don't (at least on RH Linux).
>
> -1 : The idea is to be root until we call the start. (See child).
> Tell what goes wrong we should fix it.

I don't understand.  setsid doesn't change the identity, it just puts the
(forked) process into a new session, and divorces it from the pty.  The
process is still running as "root".  It's similar to (or, rather, a subset
of) the Linux "daemon" API call.  Since it is good enough for Apache/httpd,
I really didn't expect any controversy on this one.

The problem is that the monitor still gets signals from my terminal session
(including HUP when I try to logout).  Similar to below, it hangs my ssh
session, since there is still an active proc in the same session as mine
when I try to logout.

>
> > 2) I want to add a -outfile and -errfile to the config options
(consistant
> > with procrun, and both defaulting to /dev/null).  stdin will get
redirected
> > to /dev/null, and stdout & stderr will get redirected to the values of
the
> > variables.  If I can get it to work, I'd also like to add the special
values
> > "&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping
and
> > starting Tomcat with jsvc hangs my ssh session on logout, since it still
has
> > open files to the pty.
>
> +1
>
> > 3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
> >     -outfile $CATALINA_HOME/logs/catalina.out \
> >     -errfile &1 \
> >     ).
>
> +1
>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


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


Re: commons-sandbox/daemon

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Bill Barker wrote:
> Ok, yes I know that this should go to commons-dev, but I don't monitor that
> list as closely and all of the active developers hang-out here.
> 
> I would like to make some changes to native/unix/native, and (keeping with
> commons conventions) should ask first.  I already have commons-sandbox
> karma, so that's not an issue.
> 
> 1) I want to call setsid (on platforms that support it) after the detach,
> since evil things happen if I don't (at least on RH Linux).

-1 : The idea is to be root until we call the start. (See child).
Tell what goes wrong we should fix it.

> 2) I want to add a -outfile and -errfile to the config options (consistant
> with procrun, and both defaulting to /dev/null).  stdin will get redirected
> to /dev/null, and stdout & stderr will get redirected to the values of the
> variables.  If I can get it to work, I'd also like to add the special values
> "&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping and
> starting Tomcat with jsvc hangs my ssh session on logout, since it still has
> open files to the pty.

+1

> 3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
>     -outfile $CATALINA_HOME/logs/catalina.out \
>     -errfile &1 \
>     ).

+1

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



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


Re: commons-sandbox/daemon

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Costin Manolache wrote:
> Bill Barker wrote:
> 
> 
>>Ok, yes I know that this should go to commons-dev, but I don't monitor
>>that list as closely and all of the active developers hang-out here.
>>
>>I would like to make some changes to native/unix/native, and (keeping with
>>commons conventions) should ask first.  I already have commons-sandbox
>>karma, so that's not an issue.
>>
>>1) I want to call setsid (on platforms that support it) after the detach,
>>since evil things happen if I don't (at least on RH Linux).
>>2) I want to add a -outfile and -errfile to the config options (consistant
>>with procrun, and both defaulting to /dev/null).  stdin will get
>>redirected to /dev/null, and stdout & stderr will get redirected to the
>>values of the
>>variables.  If I can get it to work, I'd also like to add the special
>>values
>>"&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping and
>>starting Tomcat with jsvc hangs my ssh session on logout, since it still
>>has open files to the pty.
>>3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
>>    -outfile $CATALINA_HOME/logs/catalina.out \
>>    -errfile &1 \
>>    ).
> 
> 
> +1
> 
> I know this has been discussed several times - but wouldn't be time to move
> the daemon back to tomcat ?

I have already explain why I am against this idea. I would like to see daemon 
promoted to common-daemon. For the moment I am trying to fix the stop of procrun 
in win9x.

BTW: I have added reflexion and now daemon could be used to start Tomcat5.
and would like to see daemon promote to common-daemon.

> Maybe we made a mistake by trying to move it to
> commons, it doesn't seem to gain a lot of developers or users outside
> tomcat.
> 
> Costin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 



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


Re: commons-sandbox/daemon

Posted by Costin Manolache <cm...@yahoo.com>.
Bill Barker wrote:

> Ok, yes I know that this should go to commons-dev, but I don't monitor
> that list as closely and all of the active developers hang-out here.
> 
> I would like to make some changes to native/unix/native, and (keeping with
> commons conventions) should ask first.  I already have commons-sandbox
> karma, so that's not an issue.
> 
> 1) I want to call setsid (on platforms that support it) after the detach,
> since evil things happen if I don't (at least on RH Linux).
> 2) I want to add a -outfile and -errfile to the config options (consistant
> with procrun, and both defaulting to /dev/null).  stdin will get
> redirected to /dev/null, and stdout & stderr will get redirected to the
> values of the
> variables.  If I can get it to work, I'd also like to add the special
> values
> "&1" and "&2" to simulate "2>&1".  As it stands now, manually stopping and
> starting Tomcat with jsvc hangs my ssh session on logout, since it still
> has open files to the pty.
> 3) Modify Tomcat.sh to reflect the changes in 2) (e.g. add:
>     -outfile $CATALINA_HOME/logs/catalina.out \
>     -errfile &1 \
>     ).

+1

I know this has been discussed several times - but wouldn't be time to move
the daemon back to tomcat ? Maybe we made a mistake by trying to move it to
commons, it doesn't seem to gain a lot of developers or users outside
tomcat.

Costin


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