Background processes on logout

Phil Howard KA9WGN phil at ux1.cso.uiuc.edu
Thu Feb 21 08:15:07 AEST 1991


F66204 at BARILVM.BITNET (Shaul Wallach) writes:

>   Please excuse this beginner's question. Is there any way for a
>user to log out of a UNIX system (say AIX/6000) while leaving
>background processes active? My experience seems to be that the
>logout command kills all background processes, something I want
>to prevent.

Another poster replied "man nohup".  If the background processes are dying
because of a HUP condition, that can be fixed.

However I've found that the shell often kills these processes.  Some do it
only to stopped processes and some seem to (unsociably) do this to running
processes.

I use the following trick in csh to hide background processes from the
shell:

    ( command and arguments & )

By doing:

    ( command and arguments & ) < /dev/null >& /dev/null

it won't even have the tty open unless it intentionally opens it.  In that
case you could execute the above via rsh to your local host and then there
will be no tty.  Be sure to use the /dev/null redirections to avoid rsh
waiting for a network connection to close:

    rsh `hostname` "( command and arguments & ) < /dev/null >& /dev/null"

The shown syntaxes are for csh.  Users of sh and ksh should adapt (however
it is those do it).

I just tried this on AIX/6000 and it works.
-- 

--Phil Howard, KA9WGN-- | Individual CHOICE is fundamental to a free society
<phil at ux1.cso.uiuc.edu> | no matter what the particular issue is all about.



More information about the Comp.unix.questions mailing list