[Tutor] Help with daemon
Alberto Troiano
albertito_g at hotmail.com
Fri Apr 29 00:06:19 CEST 2005
Hi
I will make it with CRON. Thanks Max for the idea
Now I have another problem
How can I kill a process???????
I know that if I run ps --user username it returns all the process started
by username even the PIDs and with kill -9 PID I destroy the process but I
don't know how to execute it from Python
I tried:
>>>import os
>>>os.system("ps --user root")
and I get
0
as a return
How can I get the PID and bind the command above with a variable?? I mean
varusername="root"
os.system("ps --user varusername")
works???????
thanks in advanced
Alberto
>From: Max Noel <maxnoel_fr at yahoo.fr>
>To: "Alberto Troiano" <albertito_g at hotmail.com>
>CC: tutor at python.org
>Subject: Re: [Tutor] Help with daemon
>Date: Wed, 27 Apr 2005 23:38:00 +0100
>
>
>On Apr 27, 2005, at 22:35, Alberto Troiano wrote:
>
>>I'm gonna give you an example:
>>
>>The program will check for new users and to check record time every 10
>>seconds. But first the program will have to finish the checking process
>>that started before so it won't be 10 seconds right?
>>Unless I have one process for each user to check the database at the same
>>time is checking other users
>
> This sounds like it'd be better done as a cron job (man cron for more
>info).
>
>-- Max
>maxnoel_fr at yahoo dot fr -- ICQ #85274019
>"Look at you hacker... A pathetic creature of meat and bone, panting and
>sweating as you run through my corridors... How can you challenge a
>perfect, immortal machine?"
>
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
Gaucho
More information about the Tutor
mailing list