I started a fastapi app and uvicorn in the background with nohup as
nohup uvicorn main:app &
and it seems it runs as root in the background and if I kill it, it will soon respawn using kill -9 $(ps -efl | grep uvicorn | head -1 | awk '{print $4}'). Is there any way to kill or stop it without rebooting the server?
You can try these alternatives.
or
And with
awk 'print $2'