Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Conversation

@rayburgemeestre
Copy link

Reason for this fix is that in my case I created a systemd unit file for CentOS7.

Issuing systemctl stop digits makes it send SIGTERM to the Python process, but there is no handler for this. In packaging/deb/templates/digits.service I see there is a "hack" for Debian (make systemd use SIGINT instead of SIGTERM), but that doesn't seem to work on CentOS7. So what I did is create a bash script that traps SIGTERM from systemd and translates it into a SIGINT for Python.

Anyway in this case, the way Python is launched (as a subshell) it won't register the default handler for SIGINT. This is a small fix that simply always registers the SIGINT handler.. More info: http://stackoverflow.com/questions/40775054/capturing-sigint-using-keyboardinterrupt-exception-works-in-terminal-not-in-scr/40785230#40785230

I have another suggestion, maybe it's a better idea to additionally listen for SIGTERM?
If that is preferred I can update this PR with that solution?

This way the Python process running DIGITS can always be stopped with
SIGINT. (Python doesn't install this default handler in all cases.)
@lukeyeager
Copy link
Member

Interesting link. I'll have to think through the implications.

If the scheduler is running, SIGTERM will shut it down. Have you seen this line?
https://github.com/NVIDIA/DIGITS/blob/v5.0.0/digits/scheduler.py#L358

@rayburgemeestre
Copy link
Author

rayburgemeestre commented Jan 24, 2017

Actually I didn't see that! So scratch my suggestion to additionally listen to SIGTERM :)

It's nice that SIGINT can be used for the server and SIGTERM for the jobs.

Edit: was a bit too hasty with writing a reply

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants