Menu

#2 add process renaming functionality

open
None
5
2014-08-24
2010-05-17
johnnnnnnn
No

Create a new configuration directive that takes a string, to be the monitored process' name.

Discussion

  • Jeremy Fincher

    Jeremy Fincher - 2010-05-25
    • assigned_to: nobody --> jemfinch
     
  • Jeremy Fincher

    Jeremy Fincher - 2010-05-25

    John: can you confirm whether your deployment Python version has access to the "ctypes' module?

     
  • Nobody/Anonymous

    Yep. The only scenarios in which we're using finitd are python >=2.6.

     
  • johnnnnnnn

    johnnnnnnn - 2010-05-26

    Presumably by a "partial" rename you mean a prctl rename, right? I have to think that the strcpy method would be doable using ctypes, too.

     
  • Jeremy Fincher

    Jeremy Fincher - 2010-05-26

    Yeah, I can call prctl through ctypes, but I can't modify argv[0] through ctypes. According to the SO link, it seems that the latter is necessary for some forms of `ps` to display the new name.

     
  • johnnnnnnn

    johnnnnnnn - 2010-05-27

    I spent a little time poking around with this. I haven't found a solution, but i'm fairly convinced one exists, using ctypes to call functions in Python.h.

    You should be able to get a reference to argv from Py_GetArgcArgv, and pass that through to strcpy (or a variant).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.