how do you return an exit code with out exiting

M

Matthew Thorley

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
 
G

Grant Edwards

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/linux-daemon-howto.html

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top