killing process

Discussion in 'Python' started by Mark d., Apr 8, 2004.

  1. Mark d.

    Mark d. Guest

    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.
     
    Mark d., Apr 8, 2004
    #1
    1. Advertising

  2. * Mark d. <> [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+m7958RAoBSAJ9Jl2vkD5jfaaBncnAQqrgt3fPdUwCfTltv
    ziZ0amH2LsqyNH7MsOa7PGk=
    =Y/YJ
    -----END PGP SIGNATURE-----
     
    Aloysio Figueiredo, Apr 8, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Johnson Sr.

    Process killing

    Michael Johnson Sr., Feb 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    358
    Michael Johnson Sr.
    Feb 10, 2004
  2. Shruti A via .NET 247
    Replies:
    0
    Views:
    753
    Shruti A via .NET 247
    May 15, 2004
  3. GregO
    Replies:
    0
    Views:
    422
    GregO
    Jul 20, 2004
  4. Anshuman
    Replies:
    0
    Views:
    415
    Anshuman
    Jan 4, 2005
  5. Sting

    killing a process in ms windows - newbie

    Sting, Dec 28, 2003, in forum: C Programming
    Replies:
    2
    Views:
    345
    Richard Bos
    Dec 29, 2003
Loading...

Share This Page