3 ms·
Sure, here's the doc this is taken from: https://www.freedesktop.org/software/systemd/man/systemd.service.html#id-1.10.2 https://www.freedesktop.org/software/sy
by raggi 4y ago
Sure, here's the doc this is taken from: https://www.freedesktop.org/software/systemd/man/systemd.service.html#id-1.10.2 https://www.freedesktop.org/software/systemd/man/systemd.ser...
You can find this doc by typing "systemd.service" into your favorite search engine.
The title I link to is the simple case example, which explains just below the content sample that it has pretty much the behavior you want:
Since no ExecStop= was specified, systemd will send SIGTERM to all processes
started from this service, and after a timeout also SIGKILL. This behavior can
be modified, see systemd.kill(5) for details.
Per this, you can either implement SIGTERM rather than SIGHUP, or you can change the stop signal. It already has a generous shutdown timeout (on one of my systems where I have a similarly simple unit, it's defaulted to 1m30s). You can change the timeout by setting https://www.freedesktop.org/software/systemd/man/systemd.service.html#TimeoutStopSec= https://www.freedesktop.org/software/systemd/man/systemd.ser...
The docs are pretty good, and worth a scan.
Edit: I forgot about the arguments, you can just add them to the ExecStart= line (doc: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= https://www.freedesktop.org/software/systemd/man/systemd.ser...).