Sponsored Content
Top Forums Programming do you believe X-application will "kill" the CDE and come back to login dialog Post 24874 by chenhao_no1 on Friday 19th of July 2002 03:20:09 AM
Old 07-19-2002
1 . thanks Perderabo
2 . I do a experiment in Compaq Tru64 Unix.
It (X-applicaton ) "kill" the CDE sometimes .
When the X-Application "kill" the CDE and let me come back to login dialog , it catch all signal SIGHUP (I use sigacton() (its sa_flags = SA_SIGINFO) ). signal SIGHUP , which sent by pid = 0 ,uid = 0 ( in fact it is [kernel idle] )
I add the tcgetsid(STDIN_FILENO) in source code , I find that When I launch the X-applicaion the "session leader" is 2345 (it will change ) , and When I launch the X-application from a menu button , its "session leader" is -1.




I can not understand why the kernel send the SIGHUP . Because :

3. "the signal is sent to the controlling process(session leader) associated with a controlling terminal if a disconnect is detected bye the terminal inferface" . But When I type the command "ps aux ",I found that the TTY of the X-applicaton is ??? , which indicate that it do not have a controlling terminal device (maybe I am wrong) . Since the X-applicaton does not have a controlling terminal , Why does the kernel sent SIGHUP to it

4 "the signal is also generated if the session leader terminato" . But I use tcgetsid(STDIN_FILENO), I find that the session leader is -1 . Since the session leader is dead (because it is -1) , how can it receive SIGHUP . (sometimes when the session leader is -1 ,the X-applicaton work correctly)
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

No utpmx entry: you must exec "login" from lowest level "shell"

Hi I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message No utpmx entry: you must exec "login" from lowest level "shell" :confused: What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. UNIX for Dummies Questions & Answers

HoHow to compile Linux dialog - "curses.h" missing ?

Hi, I tried native compile Linux dialog for Linux embedded device and got "curses.h" error message. As Linux dialog is already compiled and working as Debian .deb package (installed it). What is a way to import curses.h from other package sources to work for dialog sources compilation in my... (2 Replies)
Discussion started by: darius2
2 Replies

4. UNIX for Dummies Questions & Answers

how to install "source" command!/ broken "login.cl"!

Hello, I am new to this forums and this is my first "asking help" message! i have 2 problems: 1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory! 2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Discussion started by: astrosona
0 Replies

5. Shell Programming and Scripting

Help on using "dialog" in shell

hello, i'm experimenting on "dialog" in shell scripting consider an example : dialog --passwordbox "password" 10 30 i need to take the password typed to a variable. how can i do it. i tried it in perl by backticking the command. but its not working. give me a solution ASAP......:) (2 Replies)
Discussion started by: sunjujohn
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
SETPGID(2)						     Linux Programmer's Manual							SETPGID(2)

NAME
setpgid, getpgid, setpgrp, getpgrp - set/get process group SYNOPSIS
#include <unistd.h> int setpgid(pid_t pid, pid_t pgid); pid_t getpgid(pid_t pid); int setpgrp(void); pid_t getpgrp(void); DESCRIPTION
setpgid sets the process group ID of the process specified by pid to pgid. If pid is zero, the process ID of the current process is used. If pgid is zero, the process ID of the process specified by pid is used. If setpgid is used to move a process from one process group to another (as is done by some shells when creating pipelines), both process groups must be part of the same session. In this case, the pgid specifies an existing process group to be joined and the session ID of that group must match the session ID of the joining process. getpgid returns the process group ID of the process specified by pid. If pid is zero, the process ID of the current process is used. In the Linux DLL 4.4.1 library, setpgrp simply calls setpgid(0,0). getpgrp is equivalent to getpgid(0). Each process group is a member of a session and each process is a member of the session of which its process group is a member. Process groups are used for distribution of signals, and by terminals to arbitrate requests for their input: Processes that have the same process group as the terminal are foreground and may read, while others will block with a signal if they attempt to read. These calls are thus used by programs such as csh(1) to create process groups in implementing job control. The TIOCGPGRP and TIOCSPGRP calls described in termios(3) are used to get/set the process group of the control terminal. If a session has a controlling terminal, CLOCAL is not set and a hangup occurs, then the session leader is sent a SIGHUP. If the session leader exits, the SIGHUP signal will be sent to each process in the foreground process group of the controlling terminal. If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal will be sent to each process in the newly-orphaned process group. RETURN VALUE
On success, setpgid and setpgrp return zero. On error, -1 is returned, and errno is set appropriately. getpgid returns a process group on success. On error, -1 is returned, and errno is set appropriately. getpgrp always returns the current process group. ERRORS
EINVAL pgid is less than 0 (setpgid, setpgrp). EACCES An attempt was made to change the process group ID of one of the children of the calling process and the child had already performed an execve (setpgid, setpgrp). EPERM An attempt was made to move a process into a process group in a different session, or to change the process group ID of one of the children of the calling process and the child was in a different session, or to change the process group ID of a session leader (setpgid, setpgrp). ESRCH pid does not match any process. CONFORMING TO
The functions setpgid and getpgrp conform to POSIX.1. The function setpgrp is from BSD 4.2. The function getpgid conforms to SVr4. NOTES
POSIX took setpgid from the BSD function setpgrp. Also SysV has a function with the same name, but it is identical to setsid(2). To get the prototypes under glibc, define both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED, or use "#define _XOPEN_SOURCE n" for some integer n larger than or equal to 500. SEE ALSO
getuid(2), setsid(2), tcsetpgrp(3), termios(3) Linux 1999-09-02 SETPGID(2)
All times are GMT -4. The time now is 09:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy