Connection between terminal and processes

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Connection between terminal and processes
# 1  
Old 06-25-2018
Connection between terminal and processes

Hello!
I've just started to read System V Interface Definition and came across this entry: "Background Process Group
A background process group is any process group that is a member of a session
which has established a connection with a controlling terminal that is not in the
foreground process group."
I'd never known that there is a session between processes and the terminal, how come is this?
# 2  
Old 06-25-2018
This is how UNIX handles background processes. And who responds to a terminal keypress. There is also a setsid() system call that is used in controlling all of this. These groups are usually called sessions.

setsid(1) - Linux manual page

In compliant shells, you have commands to work within this context. Like fg and job, which are part of the shell and do not run as child processes. They are linked directly into the shell, unlike most commands - e.g., grep and ls
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 06-26-2018
Quote:
Originally Posted by saeed13r
I'd never known that there is a session between processes and the terminal, how come is this?
You probably know roughly what it's doing - foreground and background processes, SIGINT on ctrl-c, any background process clutter cleaned up with SIGHUP when you quit, et cetera. This is the minutae on how the OS accomplishes that. It needs to know what processes belong to you to do that, and "you" means your login - i.e. your controlling terminal.

This assumption goes pretty deep. Things like sudo and ssh directly talk to your controlling terminal to get passwords securely, in the expectation that a terminal is a direct realtime line to the user - and if there isn't any controlling terminal, it shouldn't even try to ask for a password.

This control scheme goes all the way back to serial line modems. Some features come directly from that - like process cleanup on exit. When a serial line modem disconnects, it tells the operating system, causing the operating system to send SIGHUP - hangup - to all the processes spawned from it!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pgrep for processes which are not associated with a terminal in Ubuntu

I would like to find all of the PIDs of processes which are not associated with a terminal and started by CRON. When I do the ps aux | less command, I see in the TTY field a lot of processes with ? character I would like to get those processes ID, is there a way to do that with pgrep? ... (1 Reply)
Discussion started by: ASF Studio
1 Replies

2. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

3. Homework & Coursework Questions

Display info about users (UID GID processes terminal)

I would like to get an opinion for my solution for this task and get feedback about better approach or mistakes I have made. 1. The problem statement, all variables and given/known data: The task is to create a script which prints information about users whose names are specified in the... (2 Replies)
Discussion started by: kornfan
2 Replies

4. Hardware

ADDS Regent 25 video terminal connection problem, help please :o(

Hi all, you may remember that I picked up an ADDS Regent 25 from where I worked a while ago. Well, I've been trying to connect it up to the laptop so that the laptop can act as a server for it. I've just finished making a cable for it, I connected the DB25 EIA loop of the ADDS to a serial... (6 Replies)
Discussion started by: RetroGamerVX
6 Replies

5. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

6. Solaris

Identifying and grouping OS processes and APP processes

Hi Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages. Any free tools or scripts to do this? Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies

7. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go? Thank you Richard (4 Replies)
Discussion started by: ukndoit
4 Replies

8. UNIX for Dummies Questions & Answers

terminal connection

Hello, I've a Solaris10 installed on a x86 based pc and want to connect via lan by using Windows&Reflection. To Set up a terminal connection to Solaris10, which services should I run on Solaris? Thanks (1 Reply)
Discussion started by: XNOR
1 Replies

9. UNIX for Dummies Questions & Answers

Howto setup terminal connection Solaris10?

Hello, Which services and daemons are used in Solaris in order to connect to Solaris10 from windows-Reflection ? Please just give me a brief information, I can read details from other resources. Thanks (0 Replies)
Discussion started by: XNOR
0 Replies

10. UNIX for Dummies Questions & Answers

concurrent terminal connections and processes

we've got solaris 5.6 installed in a ultra 5 box that serves as gateway server going to the main unix box. just like to find out how to determine the number of concurrent terminal connections and processes that the ultra 5 box can handle? and handling at present time? thanks in advance! (1 Reply)
Discussion started by: eddie_villarta
1 Replies
Login or Register to Ask a Question