Re: reacquiring controlling terminal status on a process backgrounded with nohup in the bash shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 12, 2004 at 12:34:40 -0400, Martinez, Michael wrote:
> Is there a way to reacquire controlling terminal status on a process
> that was backgrounded by the shell using nohup?

The nohup program (it's not a built-in) has nothing to do with
controlling terminals. The only thing it does is it sets handler for
SIGHUP to SIG_IGN and execs the process.

So we are at what the shell does. If the shell has job control, it can
do it. See the jobs, fg and bg builtins. Once the parent shell is dead,
there is no return. Well, it is STILL the controlling tty of that
process (noone has given it up, actualy. But noone knows now.

On the other hand if the process actualy gives up on the controlling
tty, either by explicit ioctl or by calling setsid (nohup does not do
either), there is no way back. But it can open another tty and make it
it's controlling tty, if it's not controlling other group yet.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux