Questions tagged [sigterm]

SIGTERM is one of the POSIX mandated signals; it indicates that the process should terminate, which is also the default action for SIGTERM.

238 questions
0
votes
0 answers

How to properly shutdown process in windows with python?

I run ffmpeg from python script and need to shutdown recording on demand. In Linux I just send SIGTERM. But in Windows as I understand SIGTERM replaced by SIGKILL so records needs to be remixed to play properly. After googling I found that I should…
victor1234
  • 871
  • 3
  • 12
  • 28
0
votes
1 answer

How to print to terminal from a service (reacting to SIGINT/SIGTERM) when CTRL+C-ing docker compose?

I have a service (python in that example) that prints something on SIGINT/SIGTERM. printer.py: import signal import sys import threading def runner(stop_event): while not stop_event.wait(1): print('Hi.', flush=True) stop_event =…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
0
votes
0 answers

python sending Ctrl-C to Terminal in Mac

I have managed to start a VPN with this code tunnel_file = "sudo /opt/local/sbin/openvpn2 primary_config.ovpn" VPNProcess = subprocess.Popen(tunnel_file,shell = True) The trouble is that I can't stop this process I tried…
0
votes
2 answers

Preventing tmux session created by systemd from automatically terminating on Ctrl+C

Since a few days I'm successfully running the new Minecraft Bedrock Edition dedicated server on my Ubuntu 18.04 LTS home server. Because it should be available 24/7 and automatically startup after boot I created a systemd service for a detached tmux…
FlKo
  • 805
  • 1
  • 10
  • 27
0
votes
2 answers

WIFSIGNALED returns false even if I send a signal with the kill command on Linux(Mint 18.3)

The problem: I need to print the kill signal received by a process, For example: If I send a *kill -15 1245* where 1245 is the pid of my process, my program should print something like "Process killed by signal 15", but even If I send a *kill…
0
votes
0 answers

Docker stack deploy stop container first

I cannot find a solution on the net: I automatically (re-) deploy my stack using docker stack deploy -c compose.yml atu but it seems, the service contianers are all killed immediatly, which causes problems, because they cannot shutdown properly /…
LalaBox
  • 243
  • 2
  • 4
  • 10
0
votes
1 answer

Apache2 sigterm crash on debian

I have an issue with my debian server. I have a website hosted on an apache2 but 2 times per day, apache crash and my website is not accessible. I have looked log files and I haven't a lot of information. Here are my logs…
Flyzzx
  • 458
  • 5
  • 13
0
votes
2 answers

Stop Gracefully Tornado ioLoop

I have this async worker functionality using tornado's ioloop. I'm trying to shutdown the loop gracefully on Ctrl+C but getting the following error tornado.ioloop.TimeoutError: Operation timed out after None seconds I know I can catch it but I do…
shahaf
  • 4,750
  • 2
  • 29
  • 32
0
votes
0 answers

Set two alarm and handle them differently - UNIX/C

I need to set two alarm(). The first one to kill one process, the second one to kill all the processes I got. Obviously the first alarm is smaller than the second one. How can I handle the two SIGALRM (and then the SIGTERM) in order to make these…
palnic
  • 386
  • 1
  • 4
  • 13
0
votes
2 answers

Why systemd process running in docker container with PID 1 not forwarding SIGTERM to child processes on docker stop

We have Docker container which is running systemd as main process (PID 1). We have also started our worker processes in Docker container through systemd unit. Our Docker containers uses CentOS 7.2. We have configured the Docker stop timeout so that…
Sachin
  • 23
  • 4
0
votes
2 answers

How to prevent a process opened with popen() in C++ from receiving SIGINT signal?

I opened a process(GNUplot) from C++ with the popen() function. When I Ctrl+C to terminate the process, GNUplot also receives SIGINT signal. I want to prevent this from happening as it has an unfavorable effect on what I do. (I prefer to handle the…
0
votes
1 answer

Write log-file on sigterm in a process terminated with p.terminate()

I terminate my subprocess with p.terminate which I opened like this: p = Popen([sys.executable, args], stdin=PIPE, stdout=PIPE, stderr=open("error.txt", 'a')) As you can see I redirect all errors to a textfile so I can eaily read it. I missused…
Fuzzyma
  • 7,619
  • 6
  • 28
  • 60
0
votes
1 answer

How to stop SIGTERM and SIGKILL?

I need to run a huge process which will run for like 10+ minutes. I maxed the max_execution_time, but in my error logs I get a SIGTERM and then a SIGKILL. I read a little about SIGTERM and SIGKILL that they come from the daemon, but i Didn't figure…
Frederik Witte
  • 1,167
  • 2
  • 11
  • 35
0
votes
1 answer

How to clear a trap in a child process which was set by a parent process?

Process A sets a trap. It then creates a child process B. How can I clear the trap set by process A? processA #! /bin/bash # processA.sh trap '' 15 sh processB.sh processB #! /bin/bash # processB.sh echo "Current trap" trap -p echo…
bluetech
  • 1,380
  • 3
  • 13
  • 22
0
votes
1 answer

Powershell ISE - Ctrl-C on empty line kills executing script?

I kicked off a long-running script in ISE earlier, and started work on a second while it was running, keeping an eye on its progress in the console panel. I was copying a function call to another part of the second script when I typo'd and pushed…
Gargravarr
  • 635
  • 2
  • 10
  • 18