I have a remote server and connect via a browser to Jupyter notebooks hosted there. The jupyter service is run via
systemd. The problem is that jupyter expects two
ctrl-c commands within 5 seconds of each other to shut down cleanly.
systemd sends only one signal to halt the process, then waits for a timeout, and when it sees that jupyter hasn't stopped, finally sends a kill signal. This leads to a long delay and an unclean exit when I want to stop or restart the service. I know that systemd has an
ExecStop parameter but can't find any examples of how it is actually used, and how I can send the equivalent of two
ctrl-c keystrokes via this mechanism.
My current service file is:
ExecStart=/home/linuxbrew/.linuxbrew/bin/jupyter notebook --no-browser