469,366 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

daemonizing python

8
So I'm trying to daemonize a python script , I've got the following already

Expand|Select|Wrap|Line Numbers
  1.  if os.fork():
  2.    sys.exit()
  3.  
i'm not sure how to handle closing and then reopening stdin,stdout,stderr, or if its even needed in python
Feb 2 '07 #1
4 1482
Motoma
3,237 Expert 2GB
So I'm trying to daemonize a python script , I've got the following already

Expand|Select|Wrap|Line Numbers
  1.  if os.fork():
  2.    sys.exit()
  3.  
i'm not sure how to handle closing and then reopening stdin,stdout,stderr, or if its even needed in python
Hi jubei,
I'm not entirely sure what you are trying to accomplish. If you could elaborate on your problem and perhaps include a little more code, as well as explain what, exactly you are trying to do, I'm sure the forum will be a much greater help.
Feb 2 '07 #2
dshimer
136 Expert 100+
I'll be the first to admit that I have no idea where you are headed, and it's been almost a decade since I was on unix daily. That said, a great place to look for obscure, sometimes advanced, always helpful example code is Python Cookbook.
for example
Title: Creating a daemon the Python way
Makes mention of redirecting to /dev/null in regard to your question.
Feb 2 '07 #3
Motoma
3,237 Expert 2GB
I'll be the first to admit that I have no idea where you are headed, and it's been almost a decade since I was on unix daily. That said, a great place to look for obscure, sometimes advanced, always helpful example code is Python Cookbook.
for example
Title: Creating a daemon the Python way
Makes mention of redirecting to /dev/null in regard to your question.
Great links dshimer, thanks!
Feb 2 '07 #4
jubei
8
dshimer, Thanks for the link, thats exactly what i was looking for
Feb 5 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.