![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why my firefox in Linux can't "go-back" ? | meili100 | UNIX for Dummies Questions & Answers | 2 | 02-21-2008 01:55 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| No utpmx entry: you must exec "login" from lowest level "shell" | peterpan | UNIX for Dummies Questions & Answers | 0 | 01-18-2006 04:15 AM |
| "kill -14 pid" doesn't works on all processes !! | poojac | UNIX for Advanced & Expert Users | 1 | 06-23-2005 08:14 AM |
| Restoring back files from "lost+found" directory | dhasarath | Filesystems, Disks and Memory | 1 | 09-24-2002 09:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
1 . Thanks you for reading the letter
2 . I have programe a X-application .Sometimes, I run it from terminal of CDE ,it "kill" the CDE and I meet the login dialog . I debug it . I find that the SIGHUP caused the X-app died .I do not run it from terminal of CDE ,I run it "click button" from panel , it does the same .(the CDE is killed ,come back to login dialog,the X-app receive the SIGHUP) 3 . I wonder when I run X-app from panel ,it does not have a control terminal ,who send it SIGHUP . I use "ps axj" find the X-app pid = 8874 ppid = 1 pgid = 8700 sessid = 8700 tty = ?? 4 . How can I find the session leader use ps command or others 5 .My email is chenhao_no4@yahoo.com.cn |
|
|||||
|
Please read our rules. We don't allow posters to request email responses.
I don't use CDE. But if your program is getting a SIGHUP, there is a way to find out why. You can use sigaction() to install a signal handler. A signal handler installed by sigaction will be called with a pointer to a siginfo structure. The handler can examine the values in the structure to figure out why the signal arrived. Of particular interest are si_pid (sending process ID) and si_uid (sending user ID). The handler could log this info. It could even run "ps" for the pid in question and log that. Then after it exits, you will know exactly why. And a process can always call getpgrp() to get its own process group id. And it can call getsid() to get the process group id of its session leader. |
|
||||
|
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) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|