Re: Vanishing threads in shell-script-started process on solaris 10




Tim Bradshaw wrote:
"Rama" <rama.duggal@xxxxxxxxx> wrote:
> Playing around with the problem, I got weird results. Originally, app
binaries were launched out of a bouurne shell script as daemons running
in the background. So my first attempt to debug the problem was to
launch it under dbx's control, and viola ! the problem seemd to
disappear, I saw all the daemons running with all their threads intact
for first time o 10.

Next I tried launching the daemons from bourne shell command line as
background processes (after ensuring that the shell environment
required is all set up). Still the 8 out of 12 threads died
(vanished). Tried launching from Korn-shell prompt and surprise - all
threads intact, the app apeared to be running and processig incoming
stuff. So I tried launching it out of a ksh cript, no luck, back to
vanishing threads.


Is this a tty issue? It smells like it could be one. I can't remember
the details (someone will though) but things in the background have
significantly different behaviour when they try and talk to stdin / stdout
etc. This can (or has in the past) also depend on the shell. There is an
enormous amount of magic here to do with controlling terminals, process
groups &c &c.

One thing to try might be to run it in the foreground but as detached as
you can make it be from a tty. I think something like this:

$ foo >/dev/null 2>&1 </dev/null

Then see what happens to it.

--tim

The app daemonises itself (i.e, fork, close stdin, stdout etc.) upon
startup. In any case, it does run ok when launched from command line.

.



Relevant Pages

  • Re: Vanishing threads in shell-script-started process on solaris 10
    ... Originally, app ... I saw all the daemons running with all their threads intact ... Next I tried launching the daemons from bourne shell command line as ...
    (comp.unix.solaris)
  • Re: custom shell starts before all services loaded
    ... Do you just want to launch your shell app and know when user input is available in it? ... You may end up launching a very small app as your shell. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Vanishing threads in shell-script-started process on solaris 10
    ... binaries were launched out of a bouurne shell script as daemons running ... I saw all the daemons running with all their threads intact ... Next I tried launching the daemons from bourne shell command line as ...
    (comp.unix.solaris)
  • Re: Auto Restart a Custom Shell on termination
    ... When I deal with different shells for Windows OSes I also prefer writing my own agent app that will take care of launching whatever ... - have a peice of code in your custom shell app to launch explorer.exe ... > I'm still wondering why this functionality do not work for your shell also. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Return Value from Background System Call
    ... The meaning of a 0 exit status has to be interpreted in the context of the ... launched app. ... Since you're launching this app in the ... status of the shell that launched your background app" at the end of the ...
    (comp.lang.perl.misc)