Python3 daemon module
pip3 install mydaemon
See sample Python script which run as a service (daemon)
python3 myservice.py start
python3 myservice.py restart
python3 myservice.py stop
See sample Python script which run as a background process. Use "stop" parameter to force to stop.
python3 myproc.py start 1
python3 myproc.py start 2
python3 myproc.py start 3
python3 myproc.py stop 2