without writing a shell script, call python directly:
nohup python Run_service.py loop=1 >dispatch.nohup 2>&1 & # where loop=1 is a parameter, you need to parse sys.argv in python; the middle > is used for redirection and can be omitted; the last & means Non-blocking operation, no other commands can be executed if not used logout #Remember this sentence is essential, otherwise the service may still be killed
2. View python related services
ps -ef | grep python
Some of the results are as follows:
3. Stop the service
kill -9 6523 #where 6523 is the process number queried by the ps command, -9 forcibly stops