Questions tagged [signals]
A signal is a message which can be sent to a running process. Signals can be initiated by programs, users, or administrators.
616
questions
0
votes
2
answers
43
views
How to send a signal to a set of pthread within one process in Linux?
I am working on an embedded Linux system (kernel-5.10.24).
There is a multi-threaded process needed to handle a certain of exception delivered through a signal.
The process is something like below.
...
3
votes
1
answer
92
views
sigqueue(3) semantics
The manpage for sigqueue(3) says that an integer or pointer may be passed as a parameter to the process that receives the signal.
Would passing a pointer imply that the sender and receiver already ...
4
votes
1
answer
780
views
What is the correct way to unconditionally kill a process?
I have two hotkeys for interactively looking up and killing a process on Linux:
bindsym $mod+k exec --no-startup-id \
"ps axo pid,cmd | sed 1d | dmenu -i -l 20 | awk '{print $1}' | xargs kill&...
0
votes
1
answer
49
views
How is PID 1 made special and unkillable?
Using docker, I recently found that PID 1 is by default unkillable by SIGTERM. Yet you can still catch SIGTERM in PID 1 if you setup a handler in the process. So this doesn't seem to be the case of ...
3
votes
1
answer
282
views
SIGPIPE and bash pipefail
I am trying to better understand SIGPIPE on linux.
I ran this experiment: { ls -al /tmp/ ; echo "$?" 1>&2 ; } | head
and it echos 141 which I understand is an exit code that is given ...
0
votes
1
answer
47
views
SIGTSTP(Ctrl-Z) not working for script started by script command
Note: script refers to the script command,
which logs stdin and stdout to files.
I was trying to run a script with the script utility to save output
for later inspection while preserving text colors ...
1
vote
0
answers
27
views
How does siglongjmp work with multiple signal handlers
I am following the APUE textbook on siglongjump(), and there is this piece of code which is confusing me.
pr_mask() is simply a function which prints the signals which are masked.
According to this, ...
2
votes
1
answer
118
views
When SIGTERM is received by a process, what happens to its children?
I am wondering what happens when a process receives SIGTERM and it has children spawned (e.g. JVM that has /bin/sh commands running).
Is there some sort of automatism or does the parent simply exit ...
0
votes
0
answers
60
views
how to send signal to (parent process?) telling the parent that the child is crashing
This is probably not a best practice, but I am trying it out.
I have this entrypoint.sh file that I use with docker like so:
ENTRYPOINT ["./entrypoint.sh"]
here was entrypoint.sh:
#!/usr/...
0
votes
0
answers
59
views
What could be causing processes to be suspended?
This excerpt from a shell session says it all:
brandon@Air ~ % brew upgrade rust
...
==> Pouring rust--1.75.0.arm64_monterey.bottle.tar.gz
[1] + 76816 suspended (signal) brew upgrade rust
...
1
vote
1
answer
76
views
What does code number mean in unhandled signals?
I run a custom GNU/Linux distro on an RISC-V Ariane CVA6 processor running on a custom design on an FPGA.
I am getting a bus error when I try to read from a memory mapped I/O register. I have verified ...
0
votes
2
answers
644
views
Cannot easily kill child processes started with bash
In general I find child processes to be a nightmare - if I have this:
#!/usr/bin/env bash
( proc_one ) &
( proc_two ) &
wait
if i ctrl-C this script, they still running the background and ...
4
votes
0
answers
47
views
Perl's `kill` is using `$! == Errno::EINTR` unexpectedly
I wrote a network daemon that forks off children to handle TCP connections.
On SIGINT the main process triggers a kill for each child in order to clean up and to collect some final statistics.
In ...
0
votes
0
answers
33
views
How to interpret different behavior of sleep and wait when they are interrupted
I'm trying to understand the subtleties between sleep and sleep & wait.
If run the script test.sh
#!/bin/bash
sleep 10000
in one terminal and ps -aef --forest in another terminal, then I see
...
1
vote
1
answer
2k
views
trying to make my own shell handle ctrl+c properly
I am trying to understand how shells are set up so that the programs they are running receive the SIGINT when you press ctrl C but the shell doesn't, because when you are running bash, and run another ...