As long as you use “sudo manage-iocs start myIOC” to start your IOC and “sudo manage-iocs stop myIOC” to stop your IOC, the Python process
"python your-python-file.py" should be automatically terminated when the IOC is stopped.
I wouldn't regard such a setup as robust enough for production use.
You might also want to look at solutions like pyDevSup [1] which can run Python code *inside* your IOC - at least that was a promising answer when the original question was discussed on TechTalk in 2019 [2].
(Yes, TechTalk has a search function, and I used it to find that link.)
Cheers,
~Ralph