470,562 Members | 2,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

how do you return an exit code with out exiting

I wrote a simple python program that scrapes a web page every 30 secons
and dumps the result in a data base. I want to use my linux distros
build in init tools to run the script in the back ground as a daemon.
The problem is when I call the daemon script to background the program I
wrote it just hangs, waiting for my program to exit 1 or 0. My program
never does exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting? or is
there are better way to do this?

Thanks
--
Matthew Thorley
Jul 19 '05 #1
2 1327
On 2005-05-23, Matthew Thorley <ru***@chpc.utah.edu> wrote:
I wrote a simple python program that scrapes a web page every
30 secons and dumps the result in a data base. I want to use
my linux distros build in init tools to run the script in the
back ground as a daemon. The problem is when I call the daemon
script to background the program I wrote it just hangs,
waiting for my program to exit 1 or 0. My program never does
exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting?
No.
or is there are better way to do this?


Yes.

To be a well-behavied daemon, you need to do the things
described in this howto:

http://www.linuxprofilm.com/articles...mon-howto.html

Here are a couple references on how to do this in Python:

http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
http://homepage.hispeed.ch/py430/python/

--
Grant Edwards grante Yow! Intra-mural sports
at results are filtering
visi.com through th' plumbing...
Jul 19 '05 #2
thanks thats perfect!

Grant Edwards wrote:
On 2005-05-23, Matthew Thorley <ru***@chpc.utah.edu> wrote:

I wrote a simple python program that scrapes a web page every
30 secons and dumps the result in a data base. I want to use
my linux distros build in init tools to run the script in the
back ground as a daemon. The problem is when I call the daemon
script to background the program I wrote it just hangs,
waiting for my program to exit 1 or 0. My program never does
exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting?

No.

or is there are better way to do this?

Yes.

To be a well-behavied daemon, you need to do the things
described in this howto:

http://www.linuxprofilm.com/articles...mon-howto.html

Here are a couple references on how to do this in Python:

http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
http://homepage.hispeed.ch/py430/python/

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rigga | last post: by
6 posts views Thread by RitaG | last post: by
2 posts views Thread by Von Bailey | last post: by
reply views Thread by Cwappy | last post: by
4 posts views Thread by amatoo04 | last post: by
4 posts views Thread by devi thapa | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.