Questions tagged [sigterm]
17 questions
5
votes
1 answer
What is the delay between SIGTERM and SIGKILL on shutdown?
When a Unix-like system is shut down normally, e.g. using halt, shutdown, poweroff etc. or the GUI equivalents, it will try to exit all processes gracefully first by emitting a SIGTERM signal to them. After some time it will send SIGKILL to the…
Hubert Grzeskowiak
- 320
- 4
- 13
3
votes
1 answer
rsync (but also other commands) run with nohup gets sigterm
I'm connecting from my computer to a HP UX B.11.31 system and am running some very lengthy there commands using nohup so I can go to sleep and do something else for a few days while they complete.
Example of such a command:
nohup rsync…
bluppfisk
- 151
- 6
2
votes
1 answer
I wish to kill a service with a "sytemctl kill logstash.service" but SIGTERM is received by the service, instead of a SIGKILL. How do I send SIGKILL?
A new logstash version I'm using can't stop, attempting to connect to Elastic all the time, while it can't (an authentication trouble, I will resolve later).
a sudo systemctl stop logstash.service isn't enough to stop it, so I've issued a sudo…
Marc Le Bihan
- 1,353
- 1
- 11
- 24
2
votes
0 answers
Java process getting terminated in Redhat by SIGTERM from Systemd
I'm starting a Java process using nohup and & (running it in the background). This process gets terminated frequently. There is no pattern on when it is getting terminated. From the application (java process) logs it was evident that it was…
Raghu
- 121
- 3
1
vote
0 answers
xargs nano leads to Received SIGHUP or SIGTERM while xargs less is OK
Scenario:
$ cat t0.txt
t1.txt
$ cat t1.txt
xxx
$ sed -n 1p t0.txt | xargs less
# OK
$ sed -n 1p t0.txt | xargs nano
Received SIGHUP or SIGTERM
dvl-linux64 $ nano --version
GNU nano, version 2.5.3
How to open file in nano? If not xargs, then…
pmor
- 509
- 5
- 11
1
vote
0 answers
Spawn, grep/find, and kill a linux process
I have a basic question which I need help with.
We have a use-case where we want to spawn a process in a different session/process-group i.e. if the parent spawning the process gets a SIGTERM, the child doesn't get the signal (or get…
instanceOfObject
- 111
- 2
1
vote
0 answers
Can't create new file with nano, Received SIGHUP or SIGTERM
I found only this question of this subject: Received SIGHUP or SIGTERM: nano cannot edit empty file
I'm configuring my web server. There wasn't any problems earlier and I would like to know exactly what is causing this error? I've installed samba…
MiQuela
- 11
- 2
1
vote
1 answer
Must SIGKILL (and SIGTERM) be explicitly sent to a specified process?
Reading Gilles' answer,
SIGHUP is about the same as SIGTERM in terms of harshness, but it has a specific role because it's automatically sent to applications running in a terminal when the user disconnects from that terminal (etymologically,…
Tim
- 98,580
- 191
- 570
- 977
0
votes
0 answers
Why does bash send SIGTERM to program after logout despite setting nohup and disown
I want to run a program which continues after logout from an ssh session.
I've tried:
nohup myProg > /tmp/logfile 2>&1 &
disown %1
and
systemd-run --scope --user myProg -p > /tmp/logfile 2>&1 &
In both cases, the process receives a SIGTERM from…
Danny
- 521
- 8
- 16
0
votes
0 answers
Trapping SIGTERM and restarting a script works exactly three times on macOS
I have a setup of two bash scripts, one starting a node server (start-server.sh) and one that runs the first script and reruns it whenever it gets terminated via SIGTERM (start.sh).
start.sh looks like this:
#!/bin/bash
trap './start-server.sh'…
linusha
- 1
- 2
0
votes
1 answer
Intercepting system signal as a strategy to prevent kill calls from taking effect
As a follow up to this question, I am correct that (4) (quote below) is the farthest I can get ?
in my app (a .NET app which runs as a systemd daemon), intercept the kernel signal sent to the process upon running kill (perhaps calling sigaction) so…
Veverke
- 338
- 3
- 16
0
votes
1 answer
Graceful termination of child in systemctl shutdown
I liked SensorSmith answer at Forward SIGTERM to child in Bash, but for my systemctl script, it resulted in a double SIGTERM, because systemctl sends SIGTERM to the parent bash instance AND the child I am running. The result was instant termination…
jws
- 101
- 1
0
votes
0 answers
Strange behavior of bash and SIGTERM with Ubuntu
Here's what happens in Ubuntu (Linux ubuntu 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, bash 4.4.20(1)):
In Terminal, open a window (let's call it "window_1") and type:
trap "echo something;"…
diciotto
- 89
- 1
- 5
0
votes
1 answer
find command killed by signal 15
I have a problem regarding the find command:
I use this line in a script to run around 300 servers and check if a file is present, returns 0 if the file is there and returns 1 if the file is not.
$(timeout 4s ssh -n $user@$servername "find / -name…
Marc Mollins
- 1
- 1
- 3
0
votes
0 answers
kill command SIGKILL vs SIGTERM
there was a nice write up somewhere on here about...
not using kill-9 all the time which is SIGKILL and explained the reasons for doing so, and then went on to explain an order in which one should proceed from least aggressive SIGTERM ending up…
ron
- 5,749
- 7
- 48
- 84