Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jobs find nothing after nohup a script

I made a python script running on background:

nohup python app.py &

then close the terminal, a few days later, I want to see this job, so I run

jobs

there list no jobs, but I'm sure the script app.py is still running.

like image 548
Mil0R3 Avatar asked Oct 24 '25 12:10

Mil0R3


1 Answers

jobs will only give you a list of process running under the session group of the bash shell. nohup processes run in their own session group. There are a number of simple commands you can run to check if your nohup'd process is still running, the simplest being lsof | grep nohup (this command may take a few seconds to run)

like image 112
Gearoid Murphy Avatar answered Oct 27 '25 02:10

Gearoid Murphy