What is sent to the process can be arbitrarily configured with ExecStop. E.g. ExecStop=/bin/kill -USR3 will cause your unit to be stopped with USR3 signal. Not that it makes any sense, but if you insist. Also, TimeoutStopSec= can be used to give the service as much time as it needs.
As for "data loss", well, you can't have both predictable stopping of processes, and allow them to take indefinite time to stop. You *can* disable the timeout with TimeoutStopSec=0, but this means that one service can hang a reboot or shutdown. I can image that it is useful in certain scenarios, but definitely it doesn't make sense as a default setting.
> the onus is clearly on systemd to support legacy programs well, not on every legacy program to learn how to beg a process that didn't exist until 20 years after they were written to not kill them.
Systemd unit files also didn't exist 20 years ago. When you'll be writing one to support the dinosaur program, you can add one or two configuration lines which will tweak the service stop mechanism.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds