From: "Eliran" <[EMAIL PROTECTED]>
> Then how does fetchmail do that ?
Fetchmail stores its PID in ~/.fetchmail.pid
>
> On Tue, Aug 13, 2002 at 09:16:29PM +0200, Eliran wrote:
>
> > import os
> > childpid = os.fork
> > if (childpid == 0):
> >child_stuff()
> > else:
> >
Then how does fetchmail do that ?
On Tue, Aug 13, 2002 at 09:16:29PM +0200, Eliran wrote:
> import os
> childpid = os.fork
> if (childpid == 0):
>child_stuff()
> else:
>os.exit()
You definitely have to keep it somewhere outside the program,
then. /var/run/foo/pid comes t
On Tue, Aug 13, 2002 at 09:16:29PM +0200, Eliran wrote:
> import os
> childpid = os.fork
> if (childpid == 0):
>child_stuff()
> else:
>os.exit()
You definitely have to keep it somewhere outside the program,
then. /var/run/foo/pid comes to mind as a reasonably place (assum
ED]>
Sent: Tuesday, August 13, 2002 8:15 PM
Subject: Re: Run daemon + Stop daemon in python
So, what's the problem again? You have the child's pid, don't you?
Not to mention that if you use 'fetchmail -q', you don't need it
anyway!
You might want to look into os.sy
On Tue, Aug 13, 2002 at 09:06:39PM +0200, Eliran wrote:
> Take the 'fetchmail' program for example.
>
> You use 'fetchmail -d nn' to start the daemon, later when you want to stop
> it you type : 'fetchmail -q' there is no special structure, I used
> the same code as you but the child's code was i
Take the 'fetchmail' program for example.
You use 'fetchmail -d nn' to start the daemon, later when you want to stop
it
you type : 'fetchmail -q' there is no special structure, I used the same
code as
you but the child's code was in a function.
==
On Tue, Aug 13, 2002 at 08:58:26PM +0200, Eliran wrote:
> Yes. But my program used : 'software -s' to start the daemon
> and later 'software -q' to stop the daemon. What? should I write
> the child's pid to a file and later read it ?
That would depend entirely on your program's structure. You cou
On Tue, Aug 13, 2002 at 08:44:15PM +0200, Eliran wrote:
> Hello !
>
> How can I start a daemon in python and later use a function to kill
it ?
The same way it's done in every other programming language?
> I used fork & kill the parent but I didn't find anyway to find the child's
> pid. Is there
Hello !
How can I start a daemon in python and later use a function to kill it ?
I used fork & kill the parent but I didn't find anyway to find the child's
pid.
Is there a better way ?
Thanks alot!
=
To unsubscribe, send mail to