I have a simple python script that just runs an infinite while loop and prints "running". When I start it up with nohup in the background, I see a nohup.out file in my current directory but nothing ever gets written to it. I am confused. I have tried the following
nohup test.py
writes to nohup.out but obviously does not run in the background
nohup test.py &
runs in background but does not write to nohup.out
nohup test.py 2>&1 &
also runs in the background but does not write to nohup.out
I bet I am missing something simple. Any ideas?
Here is my python script for reference:
import sys
from time import sleep
def main():
print "Starting...."
while True:
print "running..."
sleep(5.00)
if __name__ == "__main__":
main()