Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Exit() system call verses process signals Post 302989125 by jim mcnamara on Sunday 8th of January 2017 11:28:30 PM
Old 01-09-2017
Or to add a little to MadeInGermany's answer -

SIGKILL prevents normal process rundown. It can leave open files in bad condition, for example. You should use it only a last resort when you cannot force a process to exit. In some version of UNIX there are processes you cannot kill.

ps -u in Linux shows a column "stat".
Quote:
Status codes for Linux as of 2.6 kernel AFAIK.
Stat Meaning
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct (“zombie”) process, terminated but not reaped by its parent
D means the process cannot be killed while in the "D" status.
"Z" gets people upset completely. It means all of the processes' resources except the information kept in the kernel process header are gone. It will NOT do anything except reduce the number of total process slots by one. So if your system is configured for 65535 processes maximum, for example, then you just lost one until the "Z" process goes away. This is the result of poor programming practices - exiting and not waiting for child processes to terminate and be 'reaped'.
 

10 More Discussions You Might Find Interesting

1. Programming

Problem with signals - 3 process communication

Hello, I would like to ask you for a little help with program I'm working on. I have problems with signals and synchronizing processes (I'm quite new to this part of programming). Process "parent" creates new child process "child1" and this process creates new child process "child2". The... (2 Replies)
Discussion started by: Nightwright
2 Replies

2. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

3. UNIX for Dummies Questions & Answers

UNIX System Call for creating process

Hell Sir, This is chanikya Is there any System call which behaves just like fork but i dont want to return back two times to the calling func. In the following ex iam creating a child process in the called func but the ex prints two times IN MAIN. ex :- calling() { fork(); } ... (2 Replies)
Discussion started by: chanikya
2 Replies

4. UNIX for Advanced & Expert Users

Process signals as administration

Too generic to post elsewhere, too advanced for the newbie forums. There are some applications within the unix/linux milieu that understand signals such as SIGHUP, etc as instructions to perform administrative tasks (clearing information out of this, disconnect users, etc.) I was just wondering if... (2 Replies)
Discussion started by: thmnetwork
2 Replies

5. UNIX for Advanced & Expert Users

Ignored signals & blocking system calls

If I explicity ignore a signal (for example, SIGALRM), and this signal is generated during a blocking system call (for example, a recvfrom() ), what happens to the system call? Does it abort, or does it remain blocked until its end? (2 Replies)
Discussion started by: hurricane
2 Replies

6. Shell Programming and Scripting

process and exit to new page

File1 --> into shell file for processing --> file2 I have finished the work on my shell processing script, but I need to call this from a form -->cgi-bin, have the form wait/process bar while processing occurs (5-10 seconds) and then have the shell exit gracefully while transferring to the new... (1 Reply)
Discussion started by: dba_frog
1 Replies

7. Shell Programming and Scripting

call b.sh from a.sh, and continue to a.sh after use exit 0 from b.sh

Hi, I have two sh file. a.sh and b.sh b.sh is command and used by other sh's. I want to add below line to b.sh. When it is done with b.sh I want to continue to process a.sh. But when I use exit 0 in b.sh it is exit from b.sh and a.sh How can I make it to continue to process? a.sh ... (2 Replies)
Discussion started by: ctuncer
2 Replies

8. Shell Programming and Scripting

Check the exit status in a pipe call

Guys, I have a problem :confused: and I need some help: I've to process many huge zip files. I'd code an application that receive the data from a pipe, so I can simple unzip the data and send it (via pipe) to my app. Something like that: gzip -dc <file> | app The problem is: How can I... (7 Replies)
Discussion started by: Rkolbe
7 Replies

9. UNIX for Advanced & Expert Users

Handling Signals in System Calls

What will happen if signal comes while a system call is being executed? How it will be handled? (1 Reply)
Discussion started by: rupeshkp728
1 Replies

10. Shell Programming and Scripting

Check file if not found send mail if exit call second script

I need to check my script and change to working mode. currently it was not sending the mail and exit without calling the second script. I need to check the file is present ="/home/Rvtools/test.csv" if this file not found after the time retry send mail file not found If the file exit run the... (2 Replies)
Discussion started by: ranjancom2000
2 Replies
sigpending(2)							System Calls Manual						     sigpending(2)

NAME
sigpending - examine pending signals SYNOPSIS
DESCRIPTION
stores the set of signals that are blocked from delivery and are pending to the calling thread, at the location pointed to by set. RETURN VALUE
Upon successful completion, returns 0. Otherwise -1 is returned and is set to indicate the error. ERRORS
fails if the following condition is encountered: set points to an invalid address. The reliable detection of this error is implementation-dependent. APPLICATION USAGE
Threads Considerations The set of signals returned by is the union of the signals pending on the process and calling thread. A signal may be pending on the process if all threads block the signal. The set of signals returned by is only advisory. Since other threads may be executing at the time of the call, a signal pending on the process may be delivered to a thread after this system call returns. For more information regarding signals and threads, refer to signal(5). LWP (Lightweight Processes) Considerations The set of signals returned by is the union of the signals pending on the process and calling LWP. AUTHOR
was derived from the IEEE POSIX 1003.1-1988 Standard. SEE ALSO
sigaction(2), sigsuspend(2), sigprocmask(2), sigsetops(3C), signal(5). CHANGE HISTORY
First release in Issue 3. STANDARDS CONFORMANCE
: AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.1 sigpending(2)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy