Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   killing process (http://www.velocityreviews.com/forums/t329711-killing-process.html)

Mark d. 04-08-2004 07:11 PM

killing process
 

I have been trying to make this function run that is triggered from a
button on a Python rendered webpage. Clicking the button gets a
processID, sends a kill command for the process and then generates a
simple web page that displays the processID but the 'kill' command is
not carried out.

def restart():
pid = os.popen('pidof myProcess').read().strip()
os.popen('kill -9 %s' %pid, 'w').close()
print CGI()
print HTML(
HEAD('restart', None),
BODY(None,
'process id:',
pid
))
return 1

This works just fine in the interpreter.
Anyone have any ideas what I am overlooking?

Cheers,
Mark d.


Aloysio Figueiredo 04-08-2004 07:57 PM

Re: killing process
 
* Mark d. <mark@deverter.net> [08-04-2004 16:26]:
> This works just fine in the interpreter.
> Anyone have any ideas what I am overlooking?


Perhaps the user running apache is not allowed to kill the process...

Cheers,
Aloysio

>
> Cheers,
> Mark d.
>
> --
> http://mail.python.org/mailman/listinfo/python-list


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAda6x3Z98a+m7958RAoBSAJ9Jl2vkD5jfaaBncnAQqr gt3fPdUwCfTltv
ziZ0amH2LsqyNH7MsOa7PGk=
=Y/YJ
-----END PGP SIGNATURE-----



All times are GMT. The time now is 12:18 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57