GNU coreutils: signal specifications . commands “kill” and “nohup”

$kill -l
 1) SIGHUP	 2) SIGINT	 3) SIGQUIT	 4) SIGILL	 5) SIGTRAP
 6) SIGABRT	 7) SIGBUS	 8) SIGFPE	 9) SIGKILL	10) SIGUSR1
11) SIGSEGV	12) SIGUSR2	13) SIGPIPE	14) SIGALRM	15) SIGTERM
16) SIGSTKFLT	17) SIGCHLD	18) SIGCONT	19) SIGSTOP	20) SIGTSTP
21) SIGTTIN	22) SIGTTOU	23) SIGURG	24) SIGXCPU	25) SIGXFSZ
26) SIGVTALRM	27) SIGPROF	28) SIGWINCH	29) SIGIO	30) SIGPWR
31) SIGSYS	34) SIGRTMIN	35) SIGRTMIN+1	36) SIGRTMIN+2	37) SIGRTMIN+3
38) SIGRTMIN+4	39) SIGRTMIN+5	40) SIGRTMIN+6	41) SIGRTMIN+7	42) SIGRTMIN+8
43) SIGRTMIN+9	44) SIGRTMIN+10	45) SIGRTMIN+11	46) SIGRTMIN+12	47) SIGRTMIN+13
48) SIGRTMIN+14	49) SIGRTMIN+15	50) SIGRTMAX-14	51) SIGRTMAX-13	52) SIGRTMAX-12
53) SIGRTMAX-11	54) SIGRTMAX-10	55) SIGRTMAX-9	56) SIGRTMAX-8	57) SIGRTMAX-7
58) SIGRTMAX-6	59) SIGRTMAX-5	60) SIGRTMAX-4	61) SIGRTMAX-3	62) SIGRTMAX-2
63) SIGRTMAX-1	64) SIGRTMAX	
$kill -19 `pidof chromium-browse`
$kill -18 `pidof chromium-browse`
$kill -5 `pidof chromium-browse`
$kill -1 `pidof chromium-browse`
$nohup chromium-browser 
nohup: ignoring input and appending output to 'nohup.out'

$
$nohup chromium-browser 
nohup: ignoring input and appending output to 'nohup.out'

$
$kill -1 `pidof chromium-browse`
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
$kill -3 `pidof chromium-browse`
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
$nohup chromium-browser 
nohup: ignoring input and appending output to 'nohup.out'



$
$
$
$echo $?
0
$

Hacking with ANSI C signal Handling

$sudo strace -e trace=signal -p 1 
[sudo] password for jeffrin: 
Process 1 attached
kill(4659, SIGTERM)                     = 0
kill(4659, SIGCONT)                     = 0

$gcc crtlc1-p1.c 
$./a.out 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
Hello world 
^Ci got a signal 2
Hello world 
Hello world 
^C
$cat crtlc1-p1.c 
#include 
#include 
#include 

void ouch(int sig)
{

  printf("i got a signal %d\n",sig);
  (void) signal(SIGINT, SIG_DFL);
}

int main()
{

  (void) signal(SIGINT,ouch);

  while(1)
    {
      printf("Hello world \n");
      sleep(1);
    }
}
$

Linux KERNEL TESTING signaltest

ABOUT Signal(IPC)

Signals are a limited form of inter-process communication (IPC), typically used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronous notification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred. Signals originated in 1970s Bell Labs Unix and have been more recently specified in the POSIX standard.

When a signal is sent, the operating system interrupts the target process' normal flow of execution to deliver the signal. Execution can be interrupted during any non-atomic instruction. If the process has previously registered a signal handler, that routine is executed. Otherwise, the default signal handler is executed.

TYPICAL COMMANDLINE SESSION
[bash]
$sudo ./signaltest –help
signaltest V 0.85
Usage:
signaltest <options>

-b USEC –breaktrace=USEC send break trace command when latency > USEC
-l LOOPS –loops=LOOPS number of loops: default=0(endless)
-p PRIO –prio=PRIO priority of highest prio thread
-q –quiet print only a summary on exit
-t NUM –threads=NUM number of threads: default=2
-m –mlockall lock current and future memory allocations
-v –verbose output values on stdout for statistics
format: n:c:v n=tasknum c=count v=value in us

$sudo ./signaltest -v -t 10 -l 10
0: 0: 0
0: 1: 118
0: 2: 91
0: 3: 83
0: 4: 80
0: 5: 78
0: 6: 78
0: 7: 80
0: 8: 78
0: 9: 79
$

[/bash]
LINK
https://en.wikipedia.org/wiki/Signal_(IPC)
https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/Finding_the_source_of_signals_on_Linux_with_strace_auditd_or_Systemtap?lang=en

signal “expose-event”



g_signal_connect .
The second argument for this function is
detailed_signal : a string of the form "signal-name::detail".
source :http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html
GtkWidget is the base class for all widgets.
"expose-event" is an signal and the signal list is available at
http://library.gnome.org/devel/gtk/unstable/GtkWidget.html