|
From: <ms...@em...> - 2003-07-09 11:26:52
|
Hello, I have this little problem. I'm logged to remote server(Red Hat Linux 9) via ssh from Windows(Putty) or Linux(Xterm,Konsole). On the remote server I start wrapper (v.3.0.3), all is OK. But when I logged out then black screen appers and I have kill terminal window. In other session window user seems still log in. Does anobody know where the problem should be? Mirek _________________________________________________________________________= _______ ZNA=C8KOV=C9 PO=C8=CDTA=C8E DEXX - v=EDt=ECz testu hern=EDch PC v Computeru 11/2003, dr=BEitel Chip TIP a = TIP Po=E8=EDta=E8 pro ka=BEd=E9ho - cenov=FD trh=E1k - PC s Pentium 4 2,66 GHz, CDRW, DVD, 17" a tisk=E1rno= u za 22.990 s DPH! http://www.email.cz/dexx |
|
From: Leif M. <le...@ta...> - 2003-07-09 12:14:42
|
Mirek, I have seen this before as well. I believe it is being caused by the way the Wrapper is launching the Wrapper and JVM as detached processes. I think the hang is being caused by the shell thinking that there are are still processes running which were launched by the current shell and it is waiting for them to complete. Just a guess though... Even if you kill the shell, the Wrapper and its JVM continue to run in the background without any problems... I'll take a look at it again and see if I can figure out a way to avoid this.. If anyone has any ideas, I'd appreciate the input. Cheers, Leif ms...@em... wrote: >Hello, >I have this little problem. I'm logged to remote server(Red Hat Linux 9) >via ssh from Windows(Putty) or Linux(Xterm,Konsole). >On the remote server I start wrapper (v.3.0.3), all is OK. >But when I logged out then black screen appers and I have kill terminal >window. In other session window user seems still log in. >Does anobody know where the problem should be? > >Mirek > > > |
|
From: <da...@ix...> - 2003-08-01 22:23:28
|
In article <3F0...@ta...>,
Leif Mortenson <wra...@li...> wrote:
>If anyone has any ideas, I'd appreciate the input.
This finally annoyed me enough to look into it (ok, actually it makes our
test system hang :-).
Following is inspired from bind.
Index: src/c/wrapper_unix.c
===================================================================
RCS file: /cvsroot/wrapper/wrapper/src/c/wrapper_unix.c,v
retrieving revision 1.41
diff -u -d -u -r1.41 wrapper_unix.c
--- src/c/wrapper_unix.c 9 Jul 2003 05:59:47 -0000 1.41
+++ src/c/wrapper_unix.c 1 Aug 2003 22:17:28 -0000
@@ -561,6 +561,7 @@
*/
void daemonize() {
pid_t pid;
+ int fd;
umask(0); /* clear file creation mask */
@@ -586,6 +587,19 @@
setsid(); /* become session leader */
signal(SIGHUP, SIG_IGN); /* don't let future opens allocate controlling terminals */
+ fd = open("/dev/null", O_RDWR, 0);
+ if (fd != -1) {
+ close(STDIN_FILENO);
+ dup2(fd, STDIN_FILENO);
+ close(STDOUT_FILENO);
+ dup2(fd, STDOUT_FILENO);
+ close(STDERR_FILENO);
+ dup2(fd, STDERR_FILENO);
+ if (fd != STDIN_FILENO &&
+ fd != STDOUT_FILENO &&
+ fd != STDERR_FILENO)
+ close(fd);
+ }
/* second fork */
if (wrapperData->isDebugging) {
Also, bind is apparently sufficiently paranoid to have:
if (setsid() == -1)
printf("setsid() FAILED: %s", strerror(errno));
Whether you want to make a similar change or not....
PS: We're in the middle of QA, if you could push out a release with
the above fix, I'd REALLY appreciate it. I'd rather use an official
release from you rather than an in house build.
mrc
--
Mike Castle da...@ix... www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
|
|
From: Leif M. <le...@ta...> - 2003-08-02 16:31:52
|
Mike, you're awesome. That fixed it. Now that I see it, it makes sense.
But I don't
think I would have come up with that on my own. The changes are checked into
CVS. (Note that SF has the CVS archive mirrored so anon access is to 24 hour
old code.)
A lot has gone into this version. I'll try to get through the testing
and get a
release out sometime this week.
Cheers,
Leif
Mike Castle wrote:
>In article <3F0...@ta...>,
>Leif Mortenson <wra...@li...> wrote:
>
>
>>If anyone has any ideas, I'd appreciate the input.
>>
>>
>
>This finally annoyed me enough to look into it (ok, actually it makes our
>test system hang :-).
>
>Following is inspired from bind.
>
>Index: src/c/wrapper_unix.c
>===================================================================
>RCS file: /cvsroot/wrapper/wrapper/src/c/wrapper_unix.c,v
>retrieving revision 1.41
>diff -u -d -u -r1.41 wrapper_unix.c
>--- src/c/wrapper_unix.c 9 Jul 2003 05:59:47 -0000 1.41
>+++ src/c/wrapper_unix.c 1 Aug 2003 22:17:28 -0000
>@@ -561,6 +561,7 @@
> */
> void daemonize() {
> pid_t pid;
>+ int fd;
>
> umask(0); /* clear file creation mask */
>
>@@ -586,6 +587,19 @@
>
> setsid(); /* become session leader */
> signal(SIGHUP, SIG_IGN); /* don't let future opens allocate controlling terminals */
>+ fd = open("/dev/null", O_RDWR, 0);
>+ if (fd != -1) {
>+ close(STDIN_FILENO);
>+ dup2(fd, STDIN_FILENO);
>+ close(STDOUT_FILENO);
>+ dup2(fd, STDOUT_FILENO);
>+ close(STDERR_FILENO);
>+ dup2(fd, STDERR_FILENO);
>+ if (fd != STDIN_FILENO &&
>+ fd != STDOUT_FILENO &&
>+ fd != STDERR_FILENO)
>+ close(fd);
>+ }
>
> /* second fork */
> if (wrapperData->isDebugging) {
>
>
>Also, bind is apparently sufficiently paranoid to have:
>
> if (setsid() == -1)
> printf("setsid() FAILED: %s", strerror(errno));
>
>Whether you want to make a similar change or not....
>
>PS: We're in the middle of QA, if you could push out a release with
>the above fix, I'd REALLY appreciate it. I'd rather use an official
>release from you rather than an in house build.
>
>mrc
>
>
|
|
From: <da...@ix...> - 2003-08-02 20:16:12
|
In article <3F2...@ta...>,
Leif Mortenson <wra...@li...> wrote:
>Mike, you're awesome. That fixed it. Now that I see it, it makes sense.
>But I don't
>think I would have come up with that on my own. The changes are checked into
Feh. I'm just hard-headed.
Google is awesome.
ssh hangs exit daemon
3rd link. :->
mrc
--
Mike Castle da...@ix... www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
|