Process started by script does not receive SIGINT
4
votes
2
answers
3269
views
I am on Ubuntu 16.04.5 LTS (AWS)
I am creating a python process via this command:
nohup python -u main.py > nohup.out 2>&1 &
I would like to send a ctrl-c/SIGINT to the process, so I send kill -2
.
When I start the process from my terminal, this works fine, the program receives the keyboard interrupt and closes gracefully.
When I start the process via a .sh
script or via another bash process (e.g. bash -c 'nohup python -u main.py > nohup.out 2>&1 &'
). (I believe both methods start the process in the same way), the process does not receive the SIGINT when I send it.
SIGTERM (default kill
) works normally and closes the process, but does not let the process close gracefully, but I need.
What's happening?
Asked by Eric
(141 rep)
Dec 3, 2018, 08:08 AM
Last activity: Jun 29, 2024, 01:13 AM
Last activity: Jun 29, 2024, 01:13 AM