A python script prints information to screen and then should go to background.
How to do that from within the script itself?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update: To properly daemonize your process, use daemonize.
Original answer: Since the shell is waiting for your process to finish, the main process must terminate. You can use
os.fork()to fork off a child process andsys.exit()from the parent process: