Writing a simple linux daemon type thing...
Jones
jones at jones.jones
Fri Jun 14 08:44:14 EDT 2002
"Radovan Garabik" <spam at melkor.dnp.fmph.uniba.sk> wrote in message
news:rn3cea.rt4.ln at 127.0.0.1...
> Jones <jones at jones.jones> wrote:
> : Hi everyone,
> : I hope this is a simple question for you guys. I'm new to Python and
Linux.
> : I'm wondering if Python (and this group) can help me.
> : I want a program to always be running in the background that, connects
to
> : PostgreSQL every few seconds, queries a table, and for each record it
finds,
> : shells out to the system to execute program.
>
> : My research indicates that "nohup" might do the trick? So would it be
as
> : simple as writing the program in Python and then puting something like
> : "nohup python myprog" in the Linux startup sequence (wherever that may
be)?
>
> yes
> (python myprog &
> would be probably better)
Thank you for you reply. Just one more question. Doing what you suggest
was my first thought. But I thought I read somewhere last night that using
"&" was not a good idea..... I have no idea why (it sounds good to me), but
I guess I just want to understand the difference between running it as a
"daemon" and just running it the background... if there is one. Or maybe
someone has a URL with a good discussion on this someone could point me to.
Thanks.
More information about the Python-list
mailing list