Visit Our UNIX and Linux User Community

Process signals as administration

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Process signals as administration
# 1  
Old 11-01-2009
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 there existed any general reference for the different applications that behave that way or if anyone just happens to know of applications that do.

# 2  
Old 11-01-2009
it is application specific. if the application does not handle the signal the default action will be taken. in most cases this is terminating the process.
# 3  
Old 11-01-2009
Every application implements it on its own.
It is common to perform one of the following operations when a HUP is received:
- restart the application
- reload configuration
- quit gracefully
- messy quit
- to be unaware about the quit signal and die in an unpredicted way

In the shell scripts you have trap. Perl offers similar things (some of them are BEGIN and END blocks).
It is quite common to use nohup to run an application so that it won't die after disconnection from the console (I don't like that idea by the way): nohup my_app &. Sometime nohup tee my_app 1>log.log 2>log.log &. Crazy.
You have several signals. At least 1 of them cannot be handled by application (the app is not aware that it is killed). Other signals are defined in the source of your OS (if provided) or header files. If I remember it correctly then for linux you got signals.h or sys_signals.h... Try checking there.
HUP means HangUp - so that in the past user was connected using a slow-unreliable modem and was disconnected (caused by own choice or connection problems). This is HUP.

Previous Thread | Next Thread
Test Your Knowledge in Computers #451
Difficulty: Easy
In a 2012 online poll at Lifehacker, Linux Mint was voted the second best Linux distribution, after Ubuntu.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Exit() system call verses process signals

Hello and thanks in advance for any help anyone can offer me I've been reading up on process signal calls (sighup, sigint, sigkill & sigterm) and I understand they all have different methods of terminating a running process. From what I've also read is a exit() actually terminates a process. ... (2 Replies)
Discussion started by: bodisha
2 Replies

2. UNIX for Advanced & Expert Users

Help with Signals

Hi All, The problem statement is as below: Problem: A process (exe) is getting executed in background. The output of this process is getting logged in a file. After successfully running for some time the process gets terminated. In the log file following is present: ^M[7m Interrupt ^M[27m... (8 Replies)
Discussion started by: Praty.27
8 Replies

3. UNIX for Dummies Questions & Answers

pending signals

I was wondering about following. If I have set of 3 signals. And they are all blocked.Now at some point in the program the set is unblocked. Which signal will be delivered first.This is my set....SIGTSTP,SIGQUIT,SIGINT.When I added them in the set and unblock them I did it in following order... ... (1 Reply)
Discussion started by: joker40
1 Replies

4. UNIX for Dummies Questions & Answers

threads and signals

can any one give me an example of a concurrency program in threads and signals, i.e how to deliver messages between threads using signals. thanks (0 Replies)
Discussion started by: moe_7
0 Replies

5. Programming

Using Signals

How can use signals in a C program If i want a child program to signal it's parent program that it(child) program has completed the task that it was assigned.:confused: (2 Replies)
Discussion started by: kapilv
2 Replies

6. UNIX for Dummies Questions & Answers


(posted this in the scripting forum as well, but figured it should go here) So, what's going on is this: For our program, we had to create our own shell, and if the user pressed ctrl-c just at the cmdline, then this signal would be ignored, but if there is a foreground process running, let's... (0 Replies)
Discussion started by: blind melon
0 Replies

7. 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

8. UNIX for Advanced & Expert Users

lpsched signals

Hello, I am sure this info is somewhere on the web but have not been able to find it via google or by searching this site. On HPUX we have a model script that runs a command to capture the spool file to a repository and doesn't actually physically print the spool file. This has been working... (4 Replies)
Discussion started by: TioTony
4 Replies

9. Programming

Signals In HP-UX

does the way of handling, interrupting signals in HP-UX same as that of solaris. If there is difference than what it is.?:confused: (1 Reply)
Discussion started by: kapilv
1 Replies

Featured Tech Videos