Starting a process without a controlling terminal

Starting a process without a controlling terminal

Post by Wolfgang Den » Tue, 28 Nov 1995 04:00:00




>How can I start a process without a controlling terminal
>("ps -l" shows only a "?" in the "TTY" column) ?

Look in W. R. Stevens "Advanced programming in the UNIX  Environment"
in the chapter about daemon processes.

Quote:>I want to stop a process (kill - STOP) and continue it
>(kill - CONT) when the load of the host drops.
>But, if the shell from which the process was started was *not*
>terminated during the process is sleeping, the process is really
>killed by "kill - CONT". To solve the problem I must get rid of
>the controlling TTY after starting the process. But how?

Sounds strange. Maybe you are running some * spezies of shell?

BTW: please get your mail address / mail system fixed:

   ----- Transcript of session follows -----

   ----- Unsent message follows -----
Received: from pcf by indy1.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-1.01)
         id AA00524; Mon, 27 Nov 95 12:27:15 +0100
Received: from artemis.rus.uni-stuttgart.de by pc.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-2.1)

Received: from indy1.theochem.uni-stuttgart.de (indy1.theochem.uni-stuttgart.de [129.69.55.31]) by artemis.rus.uni-stuttgart.de with SMTP id MAA21127

Received: from pcf by indy1.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-1.01)

Received: from artemis.rus.uni-stuttgart.de by pc.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-2.1)

Received: from indy1.theochem.uni-stuttgart.de (indy1.theochem.uni-stuttgart.de [129.69.55.31]) by artemis.rus.uni-stuttgart.de with SMTP id MAA21124

Received: from pcf by indy1.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-1.01)

Received: from artemis.rus.uni-stuttgart.de by pc.theochem.uni-stuttgart.de via SMTP (931110.SGI/930416.SGI/BelWue-2.1)

Received: from indy1.theochem.uni-stuttgart.de (indy1.theochem.uni-stuttgart.de [129.69.55.31]) by artemis.rus.uni-stuttgart.de with SMTP id MAA21121
...

Wolfgang Denk



In an organization, each person rises to the level of his own  incom-
petency                                         - The Peter Principle

 
 
 

Starting a process without a controlling terminal

Post by Helmut Hay » Tue, 28 Nov 1995 04:00:00


How can I start a process without a controlling terminal
("ps -l" shows only a "?" in the "TTY" column) ?

The background:
I want to stop a process (kill - STOP) and continue it
(kill - CONT) when the load of the host drops.
But, if the shell from which the process was started was *not*
terminated during the process is sleeping, the process is really
killed by "kill - CONT". To solve the problem I must get rid of
the controlling TTY after starting the process. But how?
--
Helmut Hayd

 
 
 

Starting a process without a controlling terminal

Post by Dave Monro » Tue, 28 Nov 1995 04:00:00


Quote:> How can I start a process without a controlling terminal
> ("ps -l" shows only a "?" in the "TTY" column) ?

> The background:
> I want to stop a process (kill - STOP) and continue it
> (kill - CONT) when the load of the host drops.
> But, if the shell from which the process was started was *not*
> terminated during the process is sleeping, the process is really
> killed by "kill - CONT". To solve the problem I must get rid of
> the controlling TTY after starting the process. But how?
> --
> Helmut Hayd

    Helmut,

    Try setpgrp().  It disassociates the terminal from the process
    on most UNIX's.

    Good luck.

--
    ____                      __  ___                          
   / __ \____ __   _____     /  |/  /___  ____  _________  ___
  / / / / __ `/ | / / _ \   / /|_/ / __ \/ __ \/ ___/ __ \/ _ \
 / /_/ / /_/ /| |/ /  __/  / /  / / /_/ / / / / /  / /_/ /  __/
/_____/\__,_/ |___/\___/  /_/  /_/\____/_/ /_/_/   \____/\___/

 
 
 

Starting a process without a controlling terminal

Post by Tim Butl » Wed, 29 Nov 1995 04:00:00


:>How can I start a process without a controlling terminal
:>("ps -l" shows only a "?" in the "TTY" column) ?

:Look in W. R. Stevens "Advanced programming in the UNIX  Environment"
:in the chapter about daemon processes.

or, for a * solution:

echo ./the_command | at now

--
tim butler