A signal is a message which can be sent to a running process. Signals can be initiated by programs, users, or administrators.

learn more… | top users | synonyms

0
votes
0answers
21 views

Fixing Signal 13 Error on find

I have a situation where I'm trying to install softwares into my system. I'm using a fakeroot approach to install them in a separate directory where I'm listing all the files, directories and links ...
0
votes
1answer
34 views

send signal to command pipe tears down whole pipe

I have a simple example of two processes the first is a simple loop which does some processing #!/bin/bash function signalHandler() { echo "sig: $1 received ==> exit" for i in {1..5}; do ...
0
votes
0answers
8 views

What is the difference between the SIGHUP generated by typing “exit” in the SSH shell terminal vs clicking the “X” button in the PuTTY window?

Referring to this question, I am trying to use nohup <command> <arg> & to continue to run a command in the background after I logout from the SSH shell terminal. However, the ...
3
votes
1answer
585 views

Where can I find detailed documentation on Linux signals?

When we do kill -l we get a list of all the signals that are supported, but is there any man page that describes each signal in detail?
0
votes
2answers
43 views

What are signal traps?

Signals are the way of communication between process but I have some questions What are signal traps? How the traps are related to signals in operating system?
3
votes
2answers
51 views

Bash script is not terminated with Ctrl+C

My script cannot be terminated with Ctrl+C key. It is an error. Please explain how to modify my script to make it terminable by Ctrl+C. #!/bin/bash while true; do paplay ...
2
votes
0answers
20 views

Arbitrarily Start and Stop Process [duplicate]

This isn't a question about 'SIGSTP' and 'SIGSTOP'; I'm wondering if it's possible to save the state of a program in such a way that it can be stopped, saved to disk, and continued once the computer ...
1
vote
1answer
30 views

When a Linux (Ubuntu) system shuts down, which processes get sent a SIGTERM?

If I start an ongoing background process A which starts a child process B, and I ask the OS to shut down, which processes get sent a SIGTERM? Is it both A and B or is it just A (assuming that A should ...
3
votes
2answers
92 views

Relations between control characters, signals and terminal

What are the relations between control characters and signals? Or are they unrelated? Are control characters received by a terminal? After a terminal receives a control character, is the terminal ...
6
votes
1answer
129 views

Make bash exit != 0 when called by AWK and interrupted with ^C

I'm having an issue with the following piece of (G)AWK script: do { ... } while (system("sleep 10")) My intention is to break the loop when the user presses ^C during the sleep, but it's not ...
0
votes
1answer
36 views

How does one establish SIGRTMIN at run-time?

Reading up on signal(7) I can see that now: two, but once: three; signal numbers past 31 are reserved for use by the Real-time signal system and should not be used: Real-time Signals Linux ...
1
vote
1answer
23 views

Does a disowned process receive signals other than SIGHUP?

Is it correct that a shell can send signals only to its jobs, but can't send signals to processes which are not its jobs? disown moves a job out of the job list of a shell. Does that mean a disowned ...
4
votes
1answer
80 views

bash does not exit on abnormal exit of child process due to signal

I try really hard to understand what I am doing wrong and why? I have a launch.sh script which launches process.sh. launch.sh #!/bin/bash while true; do ./process.sh done process.sh ...
1
vote
0answers
20 views

killing subprocesses and traps

I have the following two scripts which simulate some work: start.sh simply launches 2 (mpi) processes with script mpiproc.sh. start.sh #!/bin/bash function trap_with_arg() { func="$1" ; shift ...
2
votes
1answer
23 views

Is it possible to send an xpdf process a signal that causes it to reload the file being displayed?

On page change, redraw, or Reload command, xpdf will reload the file it is currently displaying. Is it possible to cause xpdf to reload the file by sending a signal? Which signal? (I am basically ...
0
votes
1answer
35 views

Detect power loss

Is it possible to detect loss of power on a laptop/desktop without an UPS? Obviously a computer without an UPS will shutdown at least almost immediately after being unplugged/having its battery ...
31
votes
4answers
2k views

What happens when a non-root user sends signals to root user's process?

I'm wondering about the security of UNIX signals. SIGKILL will kill the process. So, what happens when a non root user's process sends a signal to a root user's process? Does the process still ...
1
vote
1answer
70 views

SIGINT handling differences between bash 3 and 4

I have a script which works great in bash 4.3, but gives me unexpected behavior with bash 3.2. Here's a simplified version: set -o errexit -o pipefail task() { local name=${1} local ...
221
votes
4answers
20k views

How does a Segmentation Fault work under-the-hood?

I can't seem to find any information on this aside from "the CPU's MMU sends a signal" and "the kernel directs it to the offending program, terminating it". I assumed that it probably sends the ...
4
votes
2answers
203 views

What happends when sending SIGKILL to a Zombie Process in Linux?

In Linux, when a child process terminates and it's parent has not yet waited on it, it becomes a zombie process. The child's exit code is stored in the pid descriptor. If a SIGKILL is sent to the ...
5
votes
1answer
59 views

Ctrl+c and Ctrl+z to interrupt/suspend jobs

To kill a hanging job, I use Ctrl+c, to send an interrupt signal to the hanging job. Sometimes this wouldn't stop the job, at least not immediately. I can then use Ctrl+z to suspend the job and then ...
3
votes
1answer
73 views

sigint not being propagated to background child process

I need to send SIGINT to terminate a process gracefully but I can't. This is a sample, because the environment in which the execution occurs is 'unknown' (a bash script in travis.com) I managed to ...
14
votes
3answers
1k views

In `dmesg | head`, (how) is dmesg being killed after 10 lines of output? [duplicate]

If I run these commands: dmesg | head -n 10 I presume the OS sends back some kind of signal to dmesg once head has read 10 lines. How does this work? What does head tell the kernel? This is ...
3
votes
1answer
58 views

`EINTR`: is there a rationale behind it?

Small talk as background EINTR is the error which so-called interruptible system calls may return. If a signal occurs while a system call is running, that signal is not ignored and a signal handler ...
1
vote
1answer
88 views

use exec -a to name process but run it in the background immune to CTRL-C

I would like to start a background process from bash script, but at the same time give it another name and also make it immune to CTRL-C. I tried the following: exec -a NiceName java -cp ....long ...
1
vote
2answers
547 views

How can I wake a process from sleep status via signal or /proc?

Many years ago I had an issue with Linux where processes would randomly go to sleep. Back then, I knew a trick with the /proc filesystem to trigger a wakeup of the process. I vaguely remember being ...
3
votes
1answer
77 views

Difference between less violent kill signal -HUP (1) -INT (2) and -TERM (15)

Apart from the most violent kill -9 (SIGKILL), I don't quite understand the difference between the 3 other common signals (here) -HUP (1), -INT (2), and -TERM (15). In which scenarios would one work ...
3
votes
4answers
49 views

Is there a variant of watch that only refreshes upon receiving a signal?

I have a window that runs a somewhat expensive watch git log ... incantation — expensive enough that it actually looks more like watch -n30 timeout 10 git log ... so that it doesn't excessively ...
1
vote
1answer
24 views

Does SIGHUP get triggered upon broken telnet/SSH connection?

I'm trying to write a mail program which might contain data that a user wouldn't want to lose upon a broken SSH/telnet connection. Would SIGHUP be sent to the process? After all, it's the "hangup" ...
10
votes
1answer
153 views

Why does a while loop stop after being suspended?

Why is it that using bash and suspending a while loop, the loop stops after being resumed? Short example below. $ while true; do echo .; sleep 1; done . . ^Z [1]+ Stopped sleep 1 $ ...
2
votes
1answer
69 views

Xvfb not sending SIGUSR1, breaking xvfb-run

I've been working a knotty problem trying to run headless tests using the xvfb-run script provided with Xvfb. It works on my own Ubuntu images running in VirtualBox, but on the Ubuntu 15.04 AMI that ...
2
votes
1answer
92 views

Bash shell launched by forkpty() spawns child processes that ignore SIGINT. Why and how do I ensure SIGINT is not ignored?

I have a C program that uses forkpty to execute a bash shell. I'm finding that the programs launched by this shell are launched with SIGINT ignored, so when I send a Ctrl-C to the shell they never ...
1
vote
1answer
73 views

Signal execution details

I am reading some Linux documentation about 'signals' and I still have these questions making noise in my mind: 1) A 'signal' handler execution is done when the 'target' process receives its ...
4
votes
1answer
74 views

What is signal queue depth in Linux

How many signals can be queued on a process that has all signals blocked? What if I use sigqueue() more often then that limit? Will those signals not be queued? Will I get an error?
2
votes
2answers
113 views

Why doesn't SIGSTOP work inside screen session?

Consider the following script: #!/bin/bash OFILE='log' echo 'ok' > ${OFILE} kill -SIGSTOP $$ echo 'after stop' > ${OFILE} In an interactive shell the script is stopped and the output is ok. ...
2
votes
0answers
30 views

Why does pacman stop when I freeze the output with ctrl+s

I sometimes use ctrl+s to send an XOFF signal to freeze the output of a program without stopping the program itself. However, pacman, unlike most other programs, stops as if you had pressed ctrl+z. It ...
6
votes
4answers
403 views

How can I handle SIGINT trap with a user prompt in shell script?

I am trying to handle SIGINT/CTRL+C interrupt in such a way that if a user accidentally presses ctrl-c, he is prompted with a message, "Do you wish to quit?(y/n)". If he enters yes, then exit the ...
2
votes
2answers
38 views

Can a tty be made unkillable?

I used PuTTY to ssh into a linux machine from a windows machine and I was just messing about with the pkill command. I quickly found out that I could log out of a remote session by typing w to show ...
1
vote
0answers
20 views

How do I escalate a signal?

For the past week, I been having a bug that my python code hasn't been doing a cleanup process properly. It was suppose to once it captures a signal caused by closing the terminal, it does some ...
1
vote
0answers
66 views

CentOS Running process not responding to kill signals and not context switched

An updatedb process on my linux server is not responding to kill signals. (kill -9 or SIGSTOP) [root@chroot-1 ~]# ps auwx | grep -i 4505 root 4505 99.5 0.0 59544 1256 ? RN 09:43 ...
5
votes
2answers
390 views

Keep exit codes when trapping SIGINT and similar?

If I use trap like described e.g. on http://linuxcommand.org/wss0160.php#trap to catch ctrl-c (or similar) and cleanup before exiting then I am changing the exit code returned. Now this probably ...
0
votes
0answers
19 views

Program is not launcher in function that is called by a signal trap

I have a bash script that requires some cleanup commands to happens when it gets closed in the console. Basically the cleanup is a restart command in my python deamon progarm (Lets call this P), ...
2
votes
0answers
67 views

What signal is sent when you close a bash terminal to the programs it was running

I have a bash script that launches a python program. The bash script handles SIGINT SIGTERM and SIGHUP signals to do a cleanup operation. I noticed that when I close the process in a tab in ...
3
votes
1answer
131 views

Sending sigaction / sigqueue through shell

I have a c++ program that handles several signals to perform different actions, using signal: signal(SIGHUP, signal_handler); I wanted to extend this signal handling to allow me to send ...
12
votes
7answers
3k views

Unable to stop a bash script with Ctrl+C

I wrote a simple bash script with a loop for printing the date and ping to a remote machine: #!/bin/bash while true; do # *** DATE: Thu Sep 17 10:17:50 CEST 2015 *** echo -e "\n*** ...
0
votes
0answers
36 views

How often is SIGHUP called in this situation?

I have situation where I am connected to my BeagleBone Black over USB cable, and I started my application in Linux terminal and I'm watching its execution, it sends me some data to terminal and it ...
1
vote
0answers
15 views

How do I terminate Aptitude safely

I have a TMux session with Aptitude open. The Aptitude process has been "killed" several times with STOP/CONT. Now it doesn't react to the Q key. Instead a 'q' is printed on the top-left corner of the ...
6
votes
1answer
386 views

Difference between closing the terminal using the closing button, and Ctrl-D

When I'm launching a background process and then closes the terminal using the window's closing button, the background process gets killed. However if I close the terminal using Ctrl+D, the background ...
1
vote
2answers
276 views

Cannot rewrite “trap command” for SIGTSTP, SIGTTIN and SIGTTOU

I want to trap the SIGTSTP signal, but I'm not able to. When I call just trap command without arguments, I'm getting this: trap -- '' SIGTSTP trap -- '' SIGTTIN trap -- '' SIGTTOU Obviously, my ...
0
votes
3answers
77 views

New signal arrives while execution is in a signal handler, how to decide which is first?

I am working on a tool handling a massive amount of signals (with different signums) with sigaction(). I need to handle the case, if a new signal is coming, while the previous was in a signal ...