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

2
votes
5answers
82 views

How to create a script that can't be easily exited

How would I create a script that does not respond to Ctrl-C? This should also prevent any processes launched by the script from being killed (I'm trying to keep apt-get upgrade from being killed). (I ...
1
vote
1answer
44 views

Ctrl+C process termination without Terminal killing

I started using Sublime Text 3 to compile my FreeFem scripts (interpretator PDEs package solver) under Ubuntu 14.04. To invoke the interpretator I customized the build system as follows "shell_cmd": ...
2
votes
1answer
34 views

What's the easiest way to detect what signals are being sent to a process?

I'm trying to debug an issue with my shell (specifically, fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving. Ideally, I'd like ...
8
votes
2answers
202 views

Why does bash ignore SIGTERM?

Sometimes when I want to logout quickly I do kill -15 -1. I've noticed that bash is ignoring SIGTERM. I wonder what's the rationale for such bash behavior? It's not very UNIX'y to ignore SIGTERM ...
3
votes
2answers
143 views

On Ctrl+C, kill the current command but continue executing the script

I have a bash script, wherein I execute a line, sleep for sometime and then tail -f my log file to verify a certain pattern is seen, I press ctrl +c to get out of tail -f and then move to the next ...
3
votes
1answer
27 views

Parent restarted by child doesn't respond to CTRL-C

I wrote a program. It starts a process (call it A) that spawns a child process (call it D) that shutdowns and restarts A. Problem is, now I can't kill A nicely from the terminal (ie. CTRL-C isn't ...
3
votes
2answers
182 views

Is there any way to determine the signal that was caught from inside a bash trap function?

I have a bash script, in which I have specified via trap that a function will be called for any (catchable) signal. typeset -i sig=1 while (( sig < 65 )); do trap myfunc $sig let sig=sig+1 ...
6
votes
3answers
357 views

Can signal be ignored (lost)?

I have an application which is communicating with workers via signals (particullary SIGUSR1/SIGUSR2/SIGSTOP). Can I trust that whatever happens every signal will be delivered and processed by ...
0
votes
1answer
48 views

timeout pipeline

I want to execute these two timeout command on the same command but with a different time and instructions. So timeout --signal=SIGINT 5s command timeout --signal=SIGKILL 10s command How to append ...
0
votes
1answer
39 views

Understanding a signal script

I have the following trap script but the idea about it, is little vague to me. #!/bin/bash for i in {1..64}; do trap "echo 'signal[$$] Caught signal SIG$(kill -l "$i")($i)'" "$i"; done; read -s ...
1
vote
0answers
70 views

SIGINFO on GNU Linux (Arch Linux) missing

I am developing an application and I would like it to print some runtime stats to the console on demand. kill and signals came to my mind immediately. Reading through Unix signals on Wiki, SIGINFO ...
1
vote
1answer
114 views

Why cannot we kill a zombie? [duplicate]

I am editing this question since it was marked duplicate as another question about how to kill a zombie process. I am not looking for an answer to how to kill a zombie process. I do not have zombies ...
5
votes
1answer
69 views

HURD: Why is remote process not killed?

On most UNIX systems this will not leave a process running: ssh example.net sleep 1000 <<CTRL-C>> I have tested this behaviour on aix centos debian dragonfly freebsd hpux irix mandriva ...
1
vote
1answer
60 views

fork() and how signals are delivered to processes

I program that I wrote in C fork()'s off a child process. Neither process will terminate. If I launch the program from the command line and press control-c which process(es) will receive the interrupt ...
0
votes
1answer
73 views

kill parent and child because endless loop

I have a process run by cron every hour. Such process calls another one (not sourced), ie: ./childProc.sh (Not sure if this detail is important) Because of an endless loop in child process (which ...
2
votes
2answers
111 views

gracefully terminating processes with killall <processname>

I am using several instances (profiles) of Icedove (Thunderbird) and when I need to close all of them, I use: killall icedove According to man killall, if no signal name is specified, SIGTERM is ...
0
votes
1answer
29 views

Trying to see default handlers for various signals

I understand that there is a default signal handler, that is a function for each signal , such as SIGKILL etc. In which file it is written? I tried looking at signal.h, but could not find it there. ...
2
votes
1answer
43 views

How to suspend a process for a certain period of time?

I have several running processes which is started by a shell, but I don't want them to run during 08:00am - 20:00pm for each day because they are really bandwidth-consuming, so , I have to suspend ...
1
vote
2answers
36 views

Give group the right to send kill signals

I have a process that a user1 runs. And I need to grant all the group members the right to send some kill signal to it. So far, I always get this output: myProcess(13919): Operation not permitted ...
0
votes
0answers
21 views

Sigstop when trying to run script?

I am trying to list out all commands by users, unfortunately I hit a weird sigstop that I am not sure how to diagnose? #!/bin/ksh echo '[' for USER in `cut -d: -f1 /etc/passwd |sed '/^#/ d'`; do ...
2
votes
1answer
59 views

SIGTERM not working occasionally

We use the regular /etc/init.d/jboss stop to stop the jboss on our machines. But at times, it does not stop the process and we get what is pasted below. When this happens we kill the process with a ...
2
votes
2answers
58 views

Inheriting Bash signal traps

I'm struggling to find clear, unambiguous information about how the trap command works. In particular, is the effect of trap local to the script where it appears? I had always assumed this to be the ...
1
vote
1answer
33 views

How to propagate TSTP while running a program as a different user

I'm running a terminal application via "su" in this fashion: su -c "/path/to/app --args" username This is done from a root context, and 'username' is a less privileged user in the system. The ...
1
vote
1answer
49 views

On shutdown, do un-mounting drives happen before shutdown signal handling?

So based on my understanding of the Unix/Linux shutdown process (which is highly limited I admit), I think at some point these steps happen: 1. mounted drives get unmounted 2. a termination signal ...
1
vote
1answer
68 views

Change to rc.local causing hang on tty1

I added a script execution command to my rc.local but forgot to run it in a separate tty. The script has an infinite loop and has hung my tty1. Ctrl-C does not do anything and I don't have another ...
5
votes
1answer
111 views

Why different behaviour of trapping EXIT vs INT

Running bash 4.3 on Kubuntu Trusty 64 bit. Please see the following two files: trapping-int.sh #! /bin/bash trap "echo Exiting" INT cat </dev/urandom >/dev/null echo Hello trapping-exit.sh ...
1
vote
1answer
355 views

Start a background process from a script and manage it when the script ends

I'd like to run and configure a process similarly to a daemon from a script. My shell is zsh emulated under Cygwin and the daemon is SFK, a basic FTP server. For what matters here, the script ...
4
votes
3answers
136 views

Control which process gets cancelled by Ctrl+C

I have a live CD that boots into Linux and runs a small Bash script. The script searches for and runs a second program (which is usually a compiled C++ binary). You're supposed to be able to abort ...
1
vote
1answer
47 views

What is the meaning of every column when executing psig command?

I try to use psig command to track signal dispositions of a process on Solaris: bash-3.2# psig 3109 3109: bash HUP caught termsig_sighandler 0 ...
1
vote
1answer
816 views

What does the command pkill -USR1 -n -x dd mean exactly?

I am using dd to do a network transfer of a disk image to an sd card on my BeagleBone. Using pkill -USR1 -n -x dd in an ssh connection to this BeagleBone gives me a status update of the transfer ...
3
votes
0answers
89 views

Kill a whole process tree regardless different GIDs

I am having issues with process control using the signals available to the process abstraction. In the example below you can see there is a perl script which is the parent of the whole tree with a ...
3
votes
1answer
61 views

Terminating SSH called from a script (SIGPIPE handling?)

so I was wondering why there are some hanging SSH connection left from some of my automated scripts and I came to a weird issue - SSH, if used without PTY, doesn't terminate when the output pipe gets ...
3
votes
1answer
77 views

How to restore the default signal processing behavior on Solaris?

I have found the signal processing behavior on my Solaris 10 is changed. For example, when I Ctrl+C, the program can't exit. Use psig to check the signal processing behavior: HUP default INT ...
2
votes
1answer
264 views

Prevent SIGINT from interrupting function call and child process(es) within

Consider the following script: #!/bin/bash set -o pipefail set -o history trapper() { func="$1" ; shift for sig ; do trap "$func $sig" "$sig" done } err_handler () { case $2 in ...
16
votes
2answers
1k views

Why does `kill -l` not list signal numbers of 32 and 33?

Executing kill -l on linux gives: 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV ...
1
vote
1answer
86 views

Send specific signal number with specific key

I want to set a specific key like F12 to send me a specific signal number that out of linux signals range that I can handle this signal with trap command. How can I do that? NOTE: I'm working with ...
4
votes
1answer
142 views

How to catch a signal in command line?

I asked this question. SIGPIPE signal is generated to stop the execution of the command as told in the answer. But how do I capture this signal and gracefully terminate the command? The command exits ...
1
vote
1answer
45 views

PID of process causing error

I have this script: #!/bin/bash # -> dump.$pid ulimit -c unlimited # trap ERR set -o errexit # also trap error in the middle of a pipe (1) # otherwise it will only trap the error on (2) set -o ...
2
votes
0answers
31 views

unbuffer/expect swallows the rcode when its child is signaled

unbuffer is able to pass along the return code of a process under normal circumstance, but if the process you are unbuffering is killed, for instance with a segfault, I see $? as 0 while I expect 139. ...
0
votes
0answers
24 views

Show signals received by processes [duplicate]

Is there a command or file that stores what signals each process receives? I know if I open one from a terminal and kill -9 PID it'll tell me, but what about something like firefox that is opened ...
1
vote
2answers
80 views

What happens to the signals requested recursively?

People often hit Ctrl + c or Ctrl + z to cancel or abandon the job if the process gets sluggish, in this case which of these signals get processed, the first one or the last one? is each signal ...
3
votes
2answers
93 views

Why is my trap not printing any log message?

What I'm doing is, trap 'rm -f /path/of/file/fileName.running; echo "TRAPPED & READY";' 1 2 9 15 >> trap.log I didn't get anything in log & the file which should have been deleted ...
11
votes
4answers
5k views

Why is SIGINT not propagated to childs process when sent to it's parent process?

Given a shell process (e.g. sh) and it's child process (e.g. cat), how to simulate the behavior of CTRL+C using the shell's process ID? This is what I've tried: Running sh and then cat: ...
2
votes
1answer
23 views

Multiple processes reporting signals received

If I run multiple programs with program & in one terminal, and then from another one start sending SIGKILL SIGINT or any other signal, will the terminal running all the processes tell me what ...
1
vote
1answer
53 views

Can Linux programs be sent a SIGXXX command they can respond to in the UI?

I am trying out the timeout command and would like to know if there is a kill signal that a GUI program, whether a graphics desktop or a terminal program will treat as the user terminating the program ...
4
votes
1answer
1k views

Forward SIGTERM to child in Bash

I have a Bash script, which looks similar to this: #!/bin/bash echo "Doing some initial work...."; /bin/start/main/server --nodaemon Now if the bash shell running the script receives a SIGTERM ...
1
vote
0answers
104 views

Trap not trapping SIGTSTP

I have a script that keeps displaying the login prompt: #!/bin/bash trap '' 2 20 while true; do login done This is part of a bigger project so please don't tell me to just use the system login ...
0
votes
3answers
64 views

Idiomatic way to kill -9 only if “graceful” way doesn't work?

Is there a common way or existing utility to do the following? kill a process Give it a few seconds to shut down gracefully kill -9 it if it hasn't stopped
4
votes
2answers
153 views

How to programatically detect when a device raises an interrupt?

How to programatically detect when a device raises an interrupt? This can be when a device is connected or disconnected. And also this case: for example: when a finger is held over a fingerprint ...
5
votes
1answer
65 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, it correctly receives and handles Ctrl+C from ...